Image copyright Reuters Image caption Chancellor Sajid Javid says he wants weekly updates from HMRC on its no-deal preparations

Chancellor Sajid Javid has written to HM Revenue and Customs, telling it to make preparing for a no-deal Brexit its "absolute top priority".

Mr Javid ordered the tax authority to help the public prepare for a no-deal - including with a business helpline and contacting traders directly.

It comes as the government ramps up preparations, after pledging to leave the EU on 31 October "deal or no deal".

HMRC said it has already been preparing for and prioritising Brexit.

And the union for civil servants, the FDA, said rather than looking to blame officials in HMRC, ministers should address the "lack of ministerial strategy or direction".

The UK is due to leave the EU on 31 October, after the leaving date was delayed twice. A "divorce" deal which sets out exactly how the UK leaves - called the withdrawal agreement - has not been agreed with the EU.

Prime Minister Boris Johnson has previously said Brexit will happen on that date - whether a deal has been agreed or not.

In the letter, which has been seen by the BBC, Mr Javid gives the chief executive of HMRC, Sir Jon Thompson, specific instructions which include:

Ensure staff and systems are in place to "deliver a functioning regime" on 31 October, for example making sure IT systems are ready and 5,000 staff are available to handle the increase in businesses making customs declarations

Support businesses and taxpayers to prepare for a no-deal and customs controls. Set up a helpline for businesses and contact traders who might be affected by customs controls but have not completed the registration needed to export to the EU.

Mr Javid also said he wanted to receive "weekly delivery-focused updates from HMRC to ensure progress remains on track" in the run-up to October 31.

Senior civil servant Sir Jon is due to stand down in the autumn. He has previously spoken about the challenges posed by a no-deal Brexit.

In November last year, Sir Jon told MPs that "the date for putting in an optimal customs system for the UK in the event of no deal was passed months ago".

Image caption Sir Jon Thompson has been chief executive of the HMRC since April 2016

Sources from the Treasury told the BBC that the letter showed that HMRC - which they called "Whitehall's unruliest department" - was being asked to "get its act together".

The sources said HMRC has "levers to speak to hundreds of thousands of businesses", and Mr Javid wants to ensure that business, especially small business, is adequately supported.

Labour MP Wes Streeting, who sits on the Treasury select committee, said the government "is living in fantasy land if it thinks that we'll be ready for no-deal by 31 October".

He said: "A no-deal Brexit would lead to instant chaos at the our ports, huge delays at Dover and unacceptable disruption to businesses of all sizes.

"It's no use ministers pointing the finger of blame at HMRC. It lies at the door of our new prime minister and his reckless approach to Brexit."

'HMRC working long hours'

Meanwhile, Jawad Raza, the national officer for the FDA union representing HMRC civil servants, said HMRC needs adequate resources if it is to make no-deal preparations the priority.

"Brexit planning remains a key priority for HMRC but the department still needs to carry out its vital day-to-day duties.

"Civil servants in HMRC have been putting a number of options forward for Brexit planning over the past three years; more than 5,000 of them have been tasked to work on preparation for our EU exit, working long, unsocial hours with no additional reward.

"Rather than looking to blame them for a lack of progress, perhaps ministers should look to themselves for the major stumbling block: a lack of ministerial strategy or direction."

A HMRC spokesman said it "has been preparing for Brexit every day since the referendum" and had hired 5,000 staff specifically to support Brexit.

He added: "HMRC has a system ready to handle customs declarations after Brexit, is rolling out a new Customs Declaration Service alongside this and has delivered new processes at the UK's borders."

Earlier this week, the government announced an extra £2.1bn of funding to prepare for a no-deal Brexit.

The plans include more border force officers and upgrades to transport infrastructure at ports, as well as money for stockpiling medicines to ensure continued supplies and a national programme to help businesses