Labour Party candidate Khan, the 45-year-old son of Pakistani immigrants to the U.K., took 44 percent in the first round of voting against his Conservative rival Zac Goldsmith, who took 35 percent.
According to election rules, the top two candidates progress to a second round when no candidate receives more than half the number of valid votes.
The second round count and the official result declared Khan’s victory shortly after midnight.
A human rights solicitor by training, Khan became Britain’s first Muslim cabinet minister in 2009 when Gordon Brown made him transport minister.
He succeeds Boris Johnson, who stood down after eight years in the role, considered the most powerful directly-elected politician in the U.K.
The mayor of London is one of the most influential posts in the country, responsible for housing and transport policy affecting more than 8.5 million people living in Britain’s capital.
Johnson attracted controversy over a Conservative Party campaign claim that Khan had connections to radical and extremist Muslims.
As the result became clear on Friday, senior Conservative figures were criticizing their own party’s election tactics, including assembly member Andrew Boff.
“I thought that was a very negative part of the campaign,” Boff told London Live.
He continued: “I received some feedback from our supporters out there in London that they felt as though they were all of a sudden under suspicion. It was a very negative thing to do and it reflected badly on the Conservative Party, because the Conservative Party is not like that.
Even Zac Goldsmith’s sister Jemima weighed in on the contentious tactics. “Sad that Zac’s campaign did not reflect who I know him to be – an eco friendly, independent – minded politician with integrity,” she tweeted hours before the official result was announced.
She also congratulated Khan. “Congratulations to @sadiqkhan – 1st Muslim Mayor of London – a city for all cultures, backgrounds & religions. A great example for to young Muslims,” she said in another tweet.
The controversial tactics though may have fueled voter interest in the contest: turnout on Thursday was reported to be 44 percent, higher than the 38.1 percent recorded in the previous election in 2012.
Speaking before the result was declared, Labour lawmaker David Lammy hailed Khan’s election as a “fantastic moment” for London.
Lammy told the BBC: “It's a massive breakthrough moment in British politics. This is the first ethnic minority coming from parliament to get a huge political mandate from millions of people in a major global city and he happens to be Muslim at a time when there are real concerns in terms of fundamentalism.
“So, it's an impressive victory. It makes me so happy to be British, and all credit to him for the tremendous hard work that he has put in.”