But the contest proved far closer than had been predicted, with the often maligned Tory candidate performing strongly, especially in the suburbs.
By 930pm on Friday, seven of City Hall’s 14 constituencies had declared, with Mr Khan having received 487,104 first preference votes to 462,837 for Mr Bailey.
This is an overnight lead of 24,267 for the Labour incumbent, with counting due to resume at 8am on Saturday.
The seven constituencies declaring on Saturday are likely to be more favourable to Mr Khan, as five of these returned a Labour majority in the 2016 mayoral and London Assembly elections.
It is also almost certain that second preference votes will come into play as neither Mr Khan nor Mr Bailey looks likely to achieve 50 per cent of the vote on first preferences alone, despite predictions from pollsters at the start of the campaign that Mr Khan was set for a landslide.
This is also likely to favour Mr Khan, with many Green and Lib-Dem voters likely to have given him their second preference vote.
The first results this evening sent social media into meltdown as they suggested that Mr Bailey could be in with a chance of pulling off arguably the most dramatic mayoral result seen since the post was established in 2000.
Results from the first four constituencies put him 5,307 votes ahead of Mr Khan.
Mr Bailey achieved a thumping lead of 56,280 votes in the Tory suburban strongholds of Bexley and Bromley, polling 100,630 to 44,350 for Mr Khan.
He also pulled off a surprise lead in Brent and Harrow, with 65,566 votes to 61,778 – a gap of 3,788.
And he was ahead in the West Central area, which covers key Tory areas such as Westminster and Kensington and Chelsea, including the Ladbroke Grove area where Mr Bailey grew up. Here he had a lead of 2,205, poling 53,713 to 51,508 for Mr Khan.
But Mr Khan scored a thumping majority of 56,966 first preference votes in the Labour stronghold of Lambeth and Southwark.
They showed that Mr Bailey exceeded expectations by some distance. In Bexley and Bromley he polled more than 100,000 votes – more than 3,000 more than Zac Goldsmith managed for the Tories in 2016.
In Brent and Harrow, the assembly seat was retained by Labour with a majority of more than 20,000 votes – but Mr Bailey outperformed his party’s assembly candidate by about 9,000 votes.
He also outperformed Mr Khan by 5,009 votes in Ealing and Hillingdon, with 79,863 votes to 74,854. This was in spite of the seat being held by Labour on the London Assembly.
Mr Bailey racked up a storming 82,361 votes in Havering and Redbridge, the constituency he and his family now call home, compared with 49,818 for Mr Khan – a net win of 32,543.
But Mr Khan performed strongly in the North East constituency, polling 67,126 more votes than his rival, 111,359 to 44,233.
In both of these east London constituencies, Mr Bailey surpassed the Tory vote achieved by Zac, now Lord, Goldsmith, in 2016 by several thousand votes – despite a fall in overall turnout.
The results also showed the Greens performing strongly, claiming second place in the Lambeth and Southwark assembly constituency and putting them on course for three or a record four assembly members.
The Lib-Dems said there results would improve tomorrow when seats such and Richmond and Kingston declare.