By Estelle Shirbon

LONDON (Reuters) - Boris Johnson, who campaigned prominently for Britain to leave the European Union ahead of a June referendum, argued in favor of remaining in the bloc in an unpublished newspaper column two days before backing Brexit, according to a newspaper report.

Former London mayor Johnson, who became foreign affairs minister in the new government that took office after the referendum, wrote columns both for and against Brexit to clarify his thoughts on the issue, the Sunday Times reported.

The report said his "remain" column argued that Britain should be intimately engaged with the EU, warned of an economic shock if it left, and suggested British financial contributions to the EU were a small price to pay for single market access.

These points all contradict arguments that Johnson made on the campaign trail, and has continued to make.

Johnson said he wrote the "semi-parodic" article backing Britain's continued membership of the EU to help confirm his belief that the country was better off leaving.

"It is perfectly true that back in February I was wrestling with (the question) like I think a lot of people in this country," Johnson told Sky News, adding that he penned the pro-EU article after writing "a long piece which came down overwhelmingly in favor of leaving".

"I set them side by side and it was blindingly obvious what the right thing to do was, and I think the people made the right decision. They voted very substantially to leave the European Union and that is what we're going to do."

The Sunday Times published excerpts from the column, written in February, in a front-page article released late on Saturday.

"This is a market on our doorstep, ready for further exploitation by British firms. The membership fee seems rather small for all that access. Why are we so determined to turn our back on it?" he wrote, according to the article.

During the campaign, Johnson traveled around Britain on a bus emblazoned with a slogan suggesting that Britain was sending 350 million pounds ($435 million) a week to the EU - a figure rejected as inaccurate by experts - and the money would be better spent on the National Health Service.

'COMPLETE BALONEY'

Before becoming foreign secretary, Johnson was better known for many years for his comic talent, colorful language and disheveled hair than for his attention to policy detail.

The son of a senior EU official who spent part of his childhood in Brussels, Johnson first made his name as a newspaper correspondent there in the early 1990s, where he wrote numerous articles denouncing European regulations.

People who knew him at that time have said that Johnson's eurosceptic beliefs were not as deeply rooted as he made out, and his Brexit stance was at least partly motivated by personal ambition and political calculation.

Those accusations were again aired on Sunday, with Scotland's first minister, Nicola Sturgeon, telling Sky that his calculation on backing Brexit was "based not on the merits of that argument but probably what he thought was best for his own political advancement".

Popular thanks to his charm and eccentricity, Johnson had been expected to put himself forward to succeed David Cameron as prime minister in the event of a vote for Brexit. Cameron had led the "remain" campaign and announced his resignation the day after the referendum.

Johnson decided against that after Michael Gove, a Cabinet minister and close ally on the Brexit campaign trail, betrayed him at the 11th hour by announcing he was standing instead.

Theresa May eventually took the top job, Gove was sacked from government, and Johnson entered the gilded halls of the Foreign Office - an appointment by May that caused consternation in some European capitals.

After he said it was "complete baloney" to suggest there was a link between the EU's principle of free movement and access to its single market, he was slapped down by French and German ministers who suggested they could send him a copy of the relevant treaty or explain the point to him in English.

($1 = 0.8042 pound)

(Editing by Matthew Lewis and Andrew Heavens)