Interim arrangements for Britain's exit from the EU will be put in place if discussions are making good progress but "haven't quite got there" within two years, the Chancellor has said.

Britain has reinvented itself before and will do again if the country faces the "catastrophe" of being closed off from EU markets, Philip Hammond warned.

Speaking at the World Economic Forum in Davos, he said that preferential migration arrangements "could" form part of the Brexit negotiations.

"That could be a subject for the negotiations," he said. "What we have said clearly is that we can't accept the principle of free movement."

Mr Hammond said quitting within two years was a "political necessity" and the broad principles can be agreed in the time scale if there is the political will in Brussels.

He said: "If we are making good progress but haven't quite got there we will simply agree that Britain will leave the European Union and we will agree some interim arrangements while we complete the discussion.

"But we think it can be done in two years if there is a political will on both sides to reach agreement on our exit and at least agreement on the broad principles of the end state that will exist between the UK and the European Union."

Mr Hammond said that Britain would "see some more" inflation this year in response to Brexit.

He added: "If we serve the notice in the end of March 2017 we will leave the European Union end of March 2019.

"That's effectively a political necessity in terms of the UK political situation and it's the legal position of the treaties.

"But we have to face the fact that there are many transitions that will be involved, business transitions, governmental transitions.

"If we change our customs arrangements we will need significant new infrastructure at the borders between the European Union and the UK.

"If we have different migration arrangements we will need significant new IT systems. These cannot be built and deployed in a few months, they are going to take years in some cases."

Mr Hammond ruled out separate negotiations for Scotland, insisting the settlement would be UK-wide.

The Chancellor insisted he "didn't issue any threats" to the EU over turning the UK into a low tax centre if it fails to agree a good exit deal.

He added: "It shouldn't be a surprise for anyone to hear that our first duty as an elected Government is to protect the living standards of our people and that means the competitiveness of our economy.

"And, if we were to be, by some catastrophe, closed off from those markets we would have to reinvent ourselves. We would have to find another model, another way to earn our living, to remain competitive in the world.

"I just want to send out a clear message that we've reinvented ourselves before. The City of London now looks radically different to the City of London ... in the 1970s.

"We can reinvent ourselves, we can reinvent our institutions and we will do so if we have to but our clear preference is to remain in that mainstream."

Mr Hammond told a later panel discussion at Davos that the "strong preference" which he shared with Prime Minister Theresa May was to secure a comprehensive free trade agreement with the remaining EU which allows Britain access to European markets.

This would allow the UK to remain "within the European economic mainstream" and "operate to European norms and European regulatory standards", said the Chancellor.

But he warned that Britain was ready to take action "in whatever way we can" to preserve its competitiveness if it was excluded from EU markets.

Already, the UK has shown that it can, despite lower productivity than its European neighbours, "maintain our competitiveness by working longer hours", he said.

Mr Hammond acknowledged that some companies were "quite understandably holding off investment decisions, waiting for the fog of Brexit to clear and to have a better understanding what the future looks like".

But he added: "The UK economy has been resilient in 2016, confounding many sceptics who believed that we would face an immediate and negative response in the economy to the Brexit referendum.

"We end 2016 as the fastest-growing of the large developed economies."

Mr Hammond said the positive economic situation depended largely on strong consumer demand in the UK.

But he said that Britain was now also seen as a "buying opportunity" by the rest of the world because of the fall in the value of sterling after the referendum.

Citing investments by Google, Apple and Japan's SoftBank, he said: "The UK is now seen as a buying opportunity because of the depreciation of the currency and the fact that fundamentally we are still a large market with 65 million affluent consumers."

Mr Hammond said that the Brexit vote was very different from the support for Donald Trump in the USA, because there was "no anti-trade rhetoric, no anti-globalisation rhetoric" on the Leave side, which instead wanted to open Britain up to trade with the rest of the world.

He pointed the finger of blame at former prime minister Tony Blair for failing to impose transitional controls on migrants from new EU member states in 2004, which had led to "a strong strand of feeling against uncontrolled migration", which played a major role in the referendum.

Prime Minister Theresa May's spokesman said it was the Government's ambition to complete exit negotiations within two years of triggering Article 50.

He told a regular Westminster briefing: "Our ambition is to have the deal wrapped up within the two-year time frame that is allotted by Article 50, but we have been very clear that there would then follow, if necessary, implementation phases across various sectors. "

Shadow chancellor John McDonnell said: " It is becoming clearer and clearer by the day that the only plan the Tories have for our country involves attempts to turn it into a tax haven.

"On Tuesday the Prime Minister said that a Tory Brexit deal would take two years, and by Friday her Chancellor is now saying that the deadline is meaningless.

"Despite the Prime Minister's pretence at having a plan, the truth is that she is making it up as she goes along. And her Chancellor's only option is to threaten to inflict on our country the worst possible alternative for our economy and the public finances by turning us into a tax haven off the coast of Europe."