Boris Johnson has defended his writing of a pro-EU article days before he publicly backed Brexit, saying the article was "semi-parodic" and the UK's decision to leave was right.
In a newspaper column drafted in February, and now published by the Sunday Times, he suggested staying in the EU would be a "boon for the world".
Mr Johnson says he was "wrestling with the issue" at the time and was merely trying to make the "alternative case".
Critics accused him of "duplicity".
Mr Johnson was a leading figure in the campaign to exit the EU and became foreign secretary after the Leave vote in the June referendum.
Amid growing pressure on the government to spell out its negotiating objectives for Brexit, Mr Johnson insisted last week that the UK could get a trade deal that was "of greater value" to the economy than access to the EU single market, which he described as an "increasingly useless" concept.
But in February's pro-Remain column, Mr Johnson backed membership of the free trade zone, describing it as "a market on our doorstep, ready for further exploitation by British firms".
He added: "The membership fee seems rather small for all that access. Why are we so determined to turn our back on it?"
In the article, which was produced at the same time as a pro-Brexit article published in the Telegraph, Mr Johnson also warned Brexit could lead to an economic shock, Scottish independence and Russian aggression.
He wrote: "There are some big questions that the 'out' side need to answer. Almost everyone expects there to be some sort of economic shock as a result of a Brexit.
"How big would it be? I am sure that the doomsters are exaggerating the fallout - but are they completely wrong? And how can we know?"
Mr Johnson had previously admitted to writing the pro-Remain piece but its contents had not been known until now - having been revealed in a new book by Sunday Times political editor Tim Shipman, All Out War.
Asked whether he had changed his views on the issue, Mr Johnson said before the referendum was called "everybody was trying to make up their minds".
"It's perfectly true that I was wrestling with it, like a lot of people in this country," he said.
"And I wrote a long piece which came down overwhelmingly in favour of leaving.
"I then thought, I'd better see if I can make the alternative case to myself, so I wrote a kind of semi-parodic article in the opposite sense, which has mysteriously found its way into the paper this morning, as I think I might have sent it to a friend.
"I set them side by side and it was blindingly obvious what the right thing to do was."
Shipman said Mr Johnson's column contradicted positions he had adopted since joining the cabinet following Theresa May's appointment as prime minister - but also "dispels the myth that Johnson's case for remain was better than his argument to leave".
Lib Dem foreign affairs spokesman Tom Brake said it would "confirm many people's suspicion that he put his own career ahead of the interests of the country".
"Boris was bang on about the threat of Brexit to the economy and the unity of the country - it is a shame he did not listen to his own warning."
Leave campaigners say pre-referendum forecasts of an immediate economic shock failed to materialise, although critics of Brexit point to the fall in the value of the pound against the dollar and the euro as evidence.
Former deputy prime minister Nick Clegg, who supported a Remain vote, suggested Mr Johnson and other "opportunists and chancers" backing Brexit had lied to the British people during the referendum campaign about the economic impact of Brexit.
"If I was a Brexit voter, I would feel increasingly betrayed that I voted in the belief that all these Brexiteers knew what they were doing," he told the BBC's Andrew Marr Show.
"I would be increasingly angry that these people, months after the referendum, still won't come clean about what they mean by Brexit."
Mr Clegg, who is part of a cross-party campaign urging a parliamentary vote on the UK's negotiating strategy with the EU, said having a "sensible and coherent plan" in place before beginning official talks would "strengthen" Mrs May's hand.
But International Development Secretary Priti Patel warned against MPs "using Parliament as a vehicle to subvert the democratic will of the British people".
She told Marr that MPs were already debating the government's strategy on a daily basis - pointing to two statements made by ministers during the past week.
"The job of the government is to deliver the result of the referendum. The British people have spoken and we are going to deliver for them."
The prime minister has said she wants the best access to EU markets for British business after Brexit but has signalled she also wants limits on freedom of movement - which EU leaders say is incompatible with continued membership of the single market.
On Sunday, First Minister Nicola Sturgeon said she believed a deal could be reached that would allow Scotland to retain access to the single market after Brexit.