Endurance Amalawa, a Nigerian university student in Greater Noida, India, has staples on his forehead after being attacked in the wake of a high school student’s death. Credit Altaf Qadri/Associated Press

NEW DELHI — On March 24, Manish Khari, a high school student from Greater Noida, a suburb of New Delhi, failed to return home after an evening walk. Some neighbors of Mr. Khari claimed to have seen him with five Nigerian students living in the area.

An irate crowd barged into the Nigerian students’ apartment but didn’t find the missing boy. His family and locals accused the Nigerian students of cannibalism. The police arrested the five Nigerian students but let them off for lack of evidence. Mr. Khari returned home quite unwell and died soon after, seemingly from a drug overdose.

Greater Noida symbolizes the post-liberalization India of aspiration, the India of new money, tower blocks, corporate offices, private universities and shopping malls. The veneer of modernity barely conceals regressive and racist social attitudes.

Ads By Google

Two days later, a vigil was held for the deceased boy at a traffic circle in Greater Noida. Endurance Amalawa and Precious Amalawa, brothers from Nigeria who are getting undergraduate degrees at a university in the area, were heading home after dinner at a restaurant at a nearby mall.

The mourners at the vigil saw the Amalawas. Being African was crime enough: A gruesome video shows how Endurance Amalawa was kicked, thrashed with sticks and bludgeoned with waste bins.

Prejudice against darker skin is deeply embedded in Indian society. When I was a child, my grandmother would scrub me with a homemade “fairness paste” because I was not as light-skinned as my cousins. Skin-whitening products have replaced Grandmother’s paste, and their sales have risen to $460 million. Fair & Lovely, the market leader in fairness creams, has annual sales worth more than $310 million.

Africans in India live with racism every day. Slurs such as “monkey” and “kalu” (blackie) are liberally thrown at them; they are often asked whether they eat human beings; they are turned away from clubs and overcharged for public transport. African men are perceived to be drug dealers, and women are seen as prostitutes.

The incidents of racist attacks have increased as a greater number of African students come to the country. According to India’s Ministry of Human Resource Development, there were 11,442 African students in the country in 2015, half of them from Nigeria and Sudan. Most of them are enrolled in new, privately run universities that conduct aggressive recruitment drives in various African countries, where educational infrastructure is strained.

African students end up renting apartments in the vicinity of their universities in lower-middle-class and middle-class neighborhoods. Racial prejudice makes it harder for them to rent. They are charged higher rents. Landlords and neighbors view them with suspicion. This friction has increasingly led to violence.

Last week I visited Michel Kyungu Kitanda, a 27-year-old Congolese man who works as a translator for Africans visiting India for medical treatment. I wanted to speak to him about his brother, Olivier Kitanda. In May 2016, Mr. Kitanda, a French-language teacher, was beaten to death by three men on a street in South Delhi after a dispute over hiring an auto rickshaw. The accused had hurled racial slurs at him and beat him with stones. He died in a hospital.

I had been interviewing Michel Kitanda barely for 10 minutes in his apartment in South Delhi when the landlady banged on his door and asked me to leave. My presence in his apartment “wasn’t proper.” With barely concealed spite she insisted that I conduct the interview in an office space downstairs.

The spate of racist attacks on African visitors belies a better, older relationship between Africans and Indians. “You gave us Gandhi; we gave you the Mahatma,” Nelson Mandela famously said. It was indeed in South Africa that Mohandas Karamchand Gandhi, a young lawyer, overcame his initial racial prejudices against Africans and emerged as a crusader against apartheid before becoming the saintly and beloved figurehead of India’s independence movement.

India was a major supporter of anticolonial struggles in Africa. Indian diasporas grew across Africa; students and scholars from Africa routinely visited and lived in India. In the 1960s, a young Somalian student rejected an American scholarship and chose to travel to India to study at Panjab University in the northern city of Chandigarh. He wrote his first novel on that campus.

He was Nuruddin Farah, the great novelist. “India and Africa are related in many different ways, which neither of them understand properly,” Mr. Farah told an Indian magazine. “We are more entwined and in tune with each other.”

India has changed. An assertive and increasingly nationalistic Indian state has limited patience for the solidarities of the past; the very suggestion of racial intolerance draws a prickly response. After the assault on Mr. Amalawa, African diplomats in India described the attack as “xenophobic and racial in nature.”

Sushma Swaraj, India’s external affairs minister, responded by calling that response “unfortunate.” Ms. Swaraj insisted that the incident couldn’t be described as racist until the police investigation was complete. A year earlier, after the killing of Mr. Kitanda, the Congolese teacher in Delhi, Ms. Swaraj had also denied the racial aspect of the murder. She had posted on Twitter, “I would like to assure African students in India that this [sic] an unfortunate and painful incident involving local goons.”

The government’s recurrent denials of racism echo the social acceptance of prejudice. Often racism and violence against Africans is explained away by resorting to stereotypes of criminality among Africans living in India.

I spoke to Vinod Singh, a government schoolteacher living in Greater Noida. His son is one of the boys arrested for assaulting Mr. Amalawa at the mall. Mr. Singh defended his son, describing him as an “onlooker,” and proceeded to speak about the Africans in his neighborhood: “Who are the drug suppliers? Everyone knows what the Nigerians are up to.

They roam around drunk at 2 a.m. They switch colleges when they fail. There are some whose visas have expired.” As an afterthought, he added, “There are some who are good too.”

African students feel insulted by Indian disavowal of racism. There have been debates in the press, but there has been no public solidarity. Ashis Nandy, India’s foremost political sociologist, puts this down to a changing political and social mood. “Once you get into the game of disliking communities, cultures and civilizations, once you start thinking of yourself as a besieged majority, a majority acting like a cornered minority, you have laid the basis of a racist society,” he said.