LONDON (Reuters) - Brexit campaigner Boris Johnson took a step closer to becoming Britain’s next prime minister on Tuesday, winning 40 percent of votes in the second round of a contest on a firm promise to leave the European Union by Oct. 31.

Johnson, the face of the official Brexit campaign in the 2016 referendum, won 126 out of 313 votes and so goes through to a third ballot between 1400 GMT and 1600 GMT on Wednesday with four other candidates who won 33 votes or more.

The former foreign minister was far ahead of the rest of the pack, stretching a lead which, for many, makes Johnson the all but inevitable victor to replace Prime Minister Theresa May and take on Britain’s so far ill-fated Brexit negotiations.

At a sometimes ill-tempered BBC debate, Johnson repeated his pledge that he would take Britain out of the EU by Oct. 31, again saying the only way to do so was to prepare for a so-called no deal exit and concentrate on winning a new trade deal.

“We must come out on the 31st of October because, otherwise I am afraid we face a catastrophic loss of confidence in politics,” Johnson said.

“October 31 is eminently feasible. Let me just say if we now say that we have a deadline that is not a deadline and we allow October 31 to come and go as March came and went and April came and went I think the public will look upon us with increasing mystification.”

With Johnson so far ahead, the race is on for second place, with Foreign Secretary Jeremy Hunt, Environment Secretary Michael Gove, International Development Secretary Rory Stewart and Home Secretary Sajid Javid all trying to prove they would be his toughest challenger.

The remaining five will now face votes until the race is whittled down to two candidates, who will face a postal ballot of the Conservative Party’s largely pro-Brexit members. A new prime minister should be chosen by the end of July.

At the debate, the four other candidates - after former Brexit minister Dominic Raab was knocked out - tried to test Johnson, a former London mayor who has so far been relatively silent in the campaign, even avoiding an earlier debate.

SORRY

Almost three years since Britain voted to leave the EU, the country, parliament and both main parties are deeply divided over how, when and even whether Brexit should happen.

With a simple message similar to the soundbites he used in the 2016 referendum campaign, Johnson, who unlike other politicians is better known by his first name, has managed to persuade much of his party that only he can rescue it from electoral disaster by delivering Brexit.

But he has attracted criticism from his rivals for promising to cut income tax for high earners.

Slideshow ( 7 images )

In Tuesday’s debate, Johnson was also taken to task for past comments in which he offended Muslims, women and others.

“In so far as my words have given offence over the last 20 or 30 years when I’ve been a journalist and people have taken those words out of my articles and escalated them... of course I am sorry for the offence they have caused,” he said.

His rise towards Downing Street is the latest twist in an eventful career for a man whose quick wit and eccentric style have helped him shrug off a series of scandals, including getting sacked from the party’s policy team while in opposition for lying about an extra-marital affair.

Slideshow ( 7 images )

That and other episodes earned him the tabloid nickname “Bonking Boris”. But where others would have floundered, Johnson became increasingly popular, culminating in his two victories in usually left-leaning London’s mayoral contests in 2008 and 2012.

After helping to win the Brexit referendum for the Leave side in 2016, Johnson’s bid to succeed David Cameron as prime minister was scuppered when his close ally Gove abruptly deserted him and announced his own candidacy.

The betrayal by Gove, whose parting shot was to say that “Boris cannot provide the leadership or build the team for the task ahead”, stopped Johnson’s march on Downing Street in 2016, allowing May to win the top job.

But her failure to get a divorce deal ratified by the British parliament destroyed her premiership.