What seemed at first to be a Twitter joke has won backing of people making serious arguments in its favour, after the capital voted Remain by a wide margin while the country as a whole voted for Leave.

Labour's Lord Livermore, who campaigned for Britain to stay in the EU, tweeted that London's independence "should be a goal", saying there is the city would have twice the GDP of fellow city state Singapore.

Independence for London within the EU should now be our goal. We would have a GDP twice as large as Singapore. pic.twitter.com/ISXhNp3toy

London Mayor Sadiq Khan sent a message to "every European resident living in London - you are very welcome here".

He said: "As a city, we are grateful for the enormous contribution you make, and that will not change as a result of this referendum.

"There are nearly one million European citizens living in London today, and they bring huge benefits to our city - working hard, paying taxes, working in our public services and contributing to our civic and cultural life.

"We all have a responsibility to now seek to heal the divisions that have emerged throughout this campaign - and to focus on what unites us, rather than that which divides us."

"Let's face it - the rest of the country disagrees. So rather than passive aggressively vote against each other at every election, let's make the divorce official and move in with our friends on the continent," the petition's author James O'Malley says.

"This petition is calling on Mayor Sadiq Khan to declare London independent, and apply to join the EU - including membership of the Schengen Zone (Umm, we'll talk about the Euro...).

"Mayor Sadiq, wouldn't you prefer to be President Sadiq? Make it happen!"

Suggesting a second independence referendum on Friday, Scottish First Minister said she said: "I have also spoken this morning with Sadiq Khan and he is clear that he shares this objective for London, so there is clear common cause between us."

As his petition gained steam, O'Malley tweeted the growing momentum was "ridiculous" and acknowledged that media were now covering his "petition that will definitely work".

Prof Tony Travers, from The London School of Economics, told the BBC the referendum results showed the stark difference between London's politics and the rest of the country, adding the mayor could argue he needs more power devolved to run it.

"Maybe moving more decision making to cities and councils could be a solution to the differences within the country," he said.

Only four of the city's borough voted for Brexit.

One Tweeter suggested that London independence was not daft because it was already a reality.

Stop saying "independence for London". You basically already have it. That is part of the problem.