LONDON (Reuters) - Boris Johnson, Britain’s most colorful politician with a long record of gaffes and scandals, was appointed as foreign secretary on Wednesday in a surprise move by new Prime Minister Theresa May that could shake up world diplomacy.

The former London mayor, who has never previously held a cabinet post and is known for his undiplomatic language, was the most prominent figure in the campaign for Britain to leave the European Union that culminated in a vote for ‘Brexit’ on June 23.

The appointment of a man who in the run-up to the referendum compared the goals of the EU with those of Adolf Hitler and Napoleon is likely to cause consternation in European capitals.

Johnson also drew accusations of racism during the campaign by suggesting in a newspaper article that U.S. President Barack Obama, whom he described as “part-Kenyan”, was biased against Britain because of an “ancestral dislike of the British empire”.

The U.S. State Department was quick to say it looked forward to working with Johnson. But he may face awkward moments in Washington over the Obama comments, as well as a 2007 article in which he likened Hillary Clinton to “a sadistic nurse in a mental hospital” and a more recent quip that he feared going to New York because of “the real risk of meeting Donald Trump”.

The rise to one of the four great offices of state was the latest twist in an eventful career for the man invariably referred to simply as “Boris”, known in Britain and beyond for his clownish persona and disheveled mop of platinum hair.

Johnson originally made his name as an EU-bashing journalist in Brussels, then entered politics in the Conservative Party while also raising his profile through a series of appearances on a hit comedy TV show.

Slideshow ( 6 images )

DOWNING STREET AMBITION THWARTED

His ability to charm people with his quick wit and eccentric style 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.

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.

His decision to defy then-Prime Minister David Cameron, who was campaigning for Britain to remain in the European Union, by leading the push for Brexit, was widely seen as a bold gamble to replace Cameron should the “Leave” side win the referendum.

After that came to pass, he was seen as the favorite for the top job, but in his hour of triumph his ambition was thwarted in dramatic fashion when his close ally Michael 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 before it had even started.

Slideshow ( 6 images )

His prospects appeared bleak as he was widely ridiculed for playing a major role in pushing Britain towards Brexit, only to duck out of the daunting task of actually steering that process. A joke that circulated widely on social media was “Cometh the hour, run awayeth the man”.

His appointment as foreign secretary was unexpected. In her previous role as interior minister, May had humiliated Johnson by refusing to allow the use of water cannons in England after, as mayor of London, he had bought three of the devices second-hand from Germany.

In a speech launching her own leadership bid on June 30, May made fun of Johnson by contrasting her own experience of negotiating with European counterparts with his.

“Last time he did a deal with the Germans he came back with three nearly-new water cannon,” she said to laughter.

With May having also appointed David Davis to the newly created post of secretary of state for exiting the European Union, Johnson’s role in detailed negotiations over the terms of Brexit is likely to be limited.

“OFFENSIVE POETRY COMPETITION”

However, he will have to handle some of the most complex and explosive diplomatic crises around the world, from Syria to Ukraine.

“At this incredibly important time ... it is extraordinary that the new prime minister has chosen someone whose career is built on making jokes,” said Tim Farron, leader of the opposition Liberal Democrats.

Despite recent efforts to project a more serious image, Johnson may well find that old and not-so-old jokes come back to haunt him in his new job.

It could be hard for him to work his charm in Turkey, a NATO member and key player in the Middle East as well as in the refugee crisis on Europe’s borders, after he was declared the winner of The Spectator magazine’s “President Erdogan Offensive Poetry Competition” in May.

The magazine ran the contest to protest against what it described as Turkish President Tayyip Erdogan’s abuse of blasphemy laws to block criticism of himself.

Johnson’s winning entry was as follows: “There was a young fellow from Ankara, Who was a terrific wankerer, Till he sowed his wild oats with the help of a goat, But he didn’t even stop to thankera”.