Soldiers could be deployed to patrol borders if Britain leaves the European Union (EU) without a deal, a top official has said.

Permanent Secretary at the Home Office, Philip Rutnam, said the option of deploying soldiers at ports and airports to provide additional capacity to check people and goods arriving in the UK could not be ruled out.

"I think it would be unwise to rule anything out. It seems to me clear that any use of the military would be an absolute last resort," he said.

"Our preference – strong preference – is to deal with the border and security needed at the border through border force and that is the basis in which our planning is proceeding." He added that officials were recruiting an addition 300 Border Force personnel.

Rutnam's comments came as Home Secretary Amber Rudd asserted there would be a deal before the UK officially leaves the EU in March 2019.

"I think it is unthinkable there would be no deal. It is so much in their interests as well as ours – in their communities', families', tourists' interests – to have something in place. We will make sure there is something between them and us to maintain our security," said Rudd.

In spite of the fact that Britain voted in favour of leaving the EU in June 2016, little progress has been made in negotiations, according to some officials.

Earlier this month, European Commission President Jean-Claude Juncker warned that the two-year Brexit process may take longer than expected, as talks seem to have reached a stalemate. His comments came in the wake of disputes during negotiations.

Brexit Secretary David Davis said that Prime Minister Theresa May's Florence speech had given "momentum to these negotiations", but that there was a "disturbing" deadlock over the size of the bill the UK has to pay to the EU.

A leaked document that emerged on 13 October suggested that some EU officials were ready to start discussing trade from December, but Brussels is refusing to move onto trade until issues such as the Irish border, citizens' rights and the divorce settlement are finalised.