Most London boroughs voted to remain in the EU - bucking the national trend.
Across all 33 boroughs in the capital, 59.9% (2.26 million) voted in favour of remaining in the EU. In some areas, the remain vote was more than 70%.
Barking and Dagenham, Bexley, Sutton, Havering and Hillingdon were the only areas to support Brexit.
Mayor Sadiq Khan said he had no doubt London would "continue to be the successful city" but called for the UK to remain part of the single market.
"Leaving the single market of 500m people - with its free-trade benefits - would be a mistake", London's leader said.
It was predicted results in London might help swing the final result in favour of remaining in the EU.
But political editor Tim Donovan said the national trend had ultimately rendered the capital "irrelevant".
Find the result in your area
BBC Radio London political reporter Susana Mendonca said the mood of Remain campaigners at London's Guildhall was lifted when the first boroughs announced their results.
But as the national picture emerged, it was members of the Leave camp who were more "chipper", she said.
The change in mood was reflected elsewhere in the capital.
Earlier, at the Barking and Dagenham count, where 62% voted to leave, UKIP's Peter Harris said he was "massively more confident" than at the beginning of the evening.
"We've smashed it," he said.
But council leader, Darren Rodwell, who supported remain, said the borough was experiencing a massive change in demographics and population flow and in five years time he said the same question would produce a very different result.
Voter turnout was 69.8%, despite torrential rain and flooding in parts of the city. The was the highest since the 1950 general election when more than 80% voted.
The breakdown of results saw:
- City of London, the first borough to return a result, vote to remain with 3,312, compared with 1,087 for leave
- Lambeth vote 111,584 votes (79%) in favour of remaining compared with 30,340 in favour of leave
- Wandsworth vote 75% (118,463) in favour of remain
- Hammersmith and Fulham, Islington, Richmond-upon-Thames, Merton and Westminster all backing the Remain campaign
- Islington vote 76,420 to 25,180 in favour of remaining in the EU
- More than 63,000 Merton voters in favour, while 37,097 wanted to exit
- Haringey (76%), Ealing (90,024 votes) and Waltham Forest also back the capital's trend backing the Remain campaign
- Other areas voting remain included Hounslow (58,755 votes), Hackney (83,398), Kensington and Chelsea (37,601), Tower Hamlets (73,011), Croydon (92,913), Enfield (56%), Camden (75%), Newham (53%) and Harrow (55%)
- Brent (72,523), 62% in Barnet, Greenwich (65,248), Kingston (52,533), Southwark (92,293), Lewisham (86,995), Redbridge (69,213) and Bromley (92,398) back the In campaign
Analysis by BBC London Political Editor Tim Donovan
London has found itself very much at odds with much of the country.
Big wins for Remain in inner London boroughs did not to give Remain the kind of momentum it needed to make a difference in the result nationally.
The final result is something approximating to 60% favouring remain, 40% for leave and of course it raises interesting questions about the capital's relationship with the rest of the country.
The key thing for London is that it has bucked the national trend; it will be seen increasingly in terms of its difference with the rest of the country.
And for some it is not just an academic question, it is a question about whether London needs more powers and control of its own finances.
In Bexley 63% backed Brexit, while in Sutton leave won with 54%. In Hillingdon 74,982 voted for leave and Havering concurred with the view with 96,885 votes.
Earlier, the BBC's political editor Laura Kuenssberg said experts predicted nearly 1.9 million people in inner London areas were likely to vote Remain, while Leave campaigners expected favourable results in outer London.
"London is an island, compared to the rest of the country where the Leave campaign is gaining ground," she added.
Biggest support for Remain
- Lambeth 79%
- Hackney 78%
- Haringey 76%
Biggest support for Leave
- Havering 70%
- Bexley 63%
- Barking and Dagenham 62%