Image copyright AFP

Ministers are paving the way to impose a contract on junior doctors in England after the profession rejected the deal that had been agreed between union negotiators and the government.

British Medical Association members voted 58% to 42% against the deal.

BMA leaders had urged members to accept the terms, which were announced in May after talks with the government resumed following six strikes.

Government sources told the BBC they were "minded" to impose the deal.

Officials are now assessing the government's legal position, but with an equality impact assessment already carried out that is thought to be a formality.

Media playback is unsupported on your device Media caption Hunt: 'Rapid decision' needed over junior doctor contract

A final announcement is expected in the coming days.

Following confirmation of the result, BMA junior doctor leader Johann Malawana resigned.

In a letter to members, Dr Malawana said the NHS was lurching "headlong into a wider crisis" that was of the government's making.

"I only hope that the next government realises that this vote is a demonstration of just how appalling frontline staff have been treated and undermined."

Image copyright Reuters

The BMA still has a mandate to take strike action, but it will be up to a new junior doctor leader to decide what the next steps are.

Ahead of the result of the vote being announced, senior sources at the BMA had indicated there was little appetite for prolonging the dispute given the climate in the country following the EU vote.

During the voting period, the government has been pushing ahead with introduction of the contract. New rotas are due to start for 6,000 newly qualified doctors in August, with the new pay system due to kick in later in the year.

Much of the rest of the 55,000-strong junior doctor workforce are then due to be moved on to the new contract from that point onwards.

Media playback is unsupported on your device Media caption Following the result, BMA junior doctor leader Johann Malawana resigned. This video footage is courtesy of the BMA

In May it was announced that talks at conciliation service Acas had finally resulted in a deal being agreed to end the long-running dispute, but the union said it would put the terms and conditions to a vote of members.

More than 100 road shows were organised where union leaders met with members to explain the new deal, which differed substantially from what the government had previously offered.

Instead of dividing the weekend between normal and unsocial hours, a system of supplements to be paid depending on how many weekends a doctor works over the course of a year was drawn up.

But many members remained unconvinced, believing it still did not properly reward them for the demands of the job, while they remained sceptical that the government's plans for a seven-day service would be properly funded.

Timeline of the dispute

December 2012 - The government invites the BMA for talks over new contract

October 2014 - BMA withdraws from talks

July 2015 - Independent pay review body publishes recommendations for a new contract

August 2015 - BMA refuses to re-enter talks

November 2015 - The government makes contract offer to junior doctors and BMA announces strikes

December 2015/January 2016 - Talks re-start at conciliation service Acas and strike for 1 December called off

January 2016 - First of four strikes, involving emergency cover being provided, is held

February 2016 - Ministers announce imposition of contract following second strike

April 2016 - First-ever all-out strike by doctors held in the history of the NHS

May 2016 - Talks restart after intervention by leaders at the royal colleges of medicine and a contract is finally agreed

July 2016 - BMA members vote to reject the contract

GP trainee Dr Francesca Silman, from London, said she voted against the new deal because of worries over working hours.

Dr Silman, who is part of the campaign group Justice for Health, said: "Moving forward, the government must now acknowledge that it is not possible to provide a seven-day NHS without extra staff and funding.

"That it is not possible to create a contract that doctors feel is safe, by stretching the current workforce."

Image copyright PA

Health Secretary Jeremy Hunt said he was seeking to make a "rapid decision".

"People in the NHS do need to know where they stand and patients who use the NHS need to know if whether we are going to proceed with our manifesto commitment for a seven-day service."

The vote was open to 54,000 BMA members - junior doctors and medical students in their final two years of their degree. More than two-thirds took part.

Labour shadow health secretary Diane Abbott said: "Today is yet another sorry episode in the saga of the government's mishandled negotiations with junior doctors."

Katherine Murphy, of the Patients Association, added: "There have been no winners in this ongoing dispute, instead it's patients who have been the losers."

Read more from Nick

Follow Nick on Twitter