LONDON — Eight weeks ago, I was among those celebrating Sadiq Khan’s election as the new mayor of London. The victory felt symbolic: Mr. Khan, a state-school-educated son of a bus driver who immigrated from Pakistan, had been given the largest personal mandate of any politician in British history. I am the same age as Mr. Khan and I’m also a state-educated son of Pakistani Muslim immigrants, and so his win felt especially validating for me. London had sent a message that it was open, tolerant and welcoming. This city, where I have lived for almost 20 years, was really a place I could feel comfortable and call home.

Thursday’s Brexit vote was a bracing reminder that London is not England. While nearly 52 percent of Britons voted to leave the European Union, London voted overwhelmingly to remain. Twenty-eight of the city’s council areas voted Remain, while just five — all outer boroughs — voted Leave. I live in Hackney, a neighborhood in north London where more than 78 percent of voters chose to remain in Europe — just behind Lambeth, in central London, for the most Europhilic place in the country.

In the days since the result, I have visited London bars, coffee shops and restaurants. The prevailing reaction has been shock and disorientation. It reminds me of the days after the death of Diana, Princess of Wales — that sense of grief and a need to process what just happened. Everywhere I went people were discussing the result of the vote and its consequences: The Turkish waiter in my neighborhood cafe was reassuring an old Turkish man, who looked shellshocked, that he didn’t need to worry. The bartender in the coffee shop was relating the latest plunge in the stock market to the woman who was buying a latte.

For many of us, Thursday’s verdict is a reminder that we live in the London of Sadiq Khan but also the Britain of Nigel Farage, the leader of the nationalist U.K. Independence Party. While the referendum was technically about the European Union, the real issue was immigration, with the Leave campaign pushing xenophobic propaganda. Since the vote, there seems to have been a surge in racist incidents.