“London is like the capital of Europe, and it’s the biggest financial capital in the world,” said Alexandra Lewis, 19, a college student in Bristol. Her London high school had students from all over, she recalled, and the British-born were in the minority.

London, she said, “needs the connections with Europe much more than the rest of the country.”

The referendum spurred demonstrations, anguish and anger across the capital, as well as dreams that the city could somehow detach itself and form its own state. A freelance writer in London, James O’Malley, started a petition calling for “Londependence,” an idea that had already begun to waft around Facebook. To his surprise, more than 175,000 people quickly signed the petition.

Mr. O’Malley had thought up the petition as a jokey protest, he explained in an article in The Daily Telegraph. He does not really think London should become a city-state like Monaco or Singapore or begin issuing its own currency, for instance. But he does support increased autonomy.

“If Scotland gets to make its own laws to reflect its own unique politics, why not the capital?” he wrote. “We all know — and the referendum made clear — that London has very different politics to the rest of the country.”

The mayor, Mr. Khan, agrees. Many of the city’s affairs are still controlled by the national government, and he has limited authority compared with the mayor of, say, New York. Mr. Khan said he would begin pressing for the same sort of devolved powers that the national government has granted to Scotland and Wales.

“On behalf of all Londoners, I am demanding more autonomy for the capital — right now,” Mr. Khan said in a speech last week. “More autonomy to protect London’s economy from the uncertainty ahead, to protect the businesses from around the world who trade here, and to protect our jobs, wealth and prosperity.”

He also moved to reassure nervous and angry residents that London is at heart an international city. He and the mayor of Paris, Anne Hidalgo, issued a statement saying they would “build far stronger alliances between cities across Europe and around the world.”