The chairman of the British Medical Association (BMA) has resigned in a row over a controversial doctors' job selection system.
James Johnson is resigning over a job selection system
The BMA's treasurer Dr David Pickersgill said colleagues had lost confidence in James Johnson.
He said Mr Johnson failed to convey the anger felt over the system for matching junior doctors to specialist posts.
But Mr Johnson accused the government of a failure of policy and warned the profession was "on the edge".
More than 34,000 doctors are chasing 18,500 training posts due to start in August.
In March thousands of trainee doctors took part in a protest rally in London.
Junior doctors had complained the system was profoundly flawed, and that many of them had been unfairly treated.
Ministers announced last week that the system, known as the Medical Training Application Service (MTAS), will be shelved for the second round of interviews for posts.
But MTAS has been subject to a legal challenge in the High Court, with a decision expected this week.
Junior doctor pressure group Remedy UK currently wants all existing posts awarded under MTAS to be made temporary until a new selection process is conducted next year.
Mr Johnson, a vascular surgeon in the north-west of England, has been chairman of the BMA for nearly four years.
He wrote a letter about MTAS with Dame Carol Black, chairman of the Academy of Medical Royal Colleges, to the Times newspaper on 17 May.
In it they reject a suggestion favoured by junior doctors at that time that a first round of interviews under the MTAS be scrapped.
They add: "We agree that a better system is needed, but believe that it should be achieved through argument and negotiation, not action that could risk harming patients, the NHS or our colleagues."
'Loss of confidence'
Dr Pickersgill said on Sunday: "While it [the letter] reflected the association's agreed position of working towards a pragmatic solution for this year, its tone failed to reflect the anger being currently expressed by members of the association, particularly junior doctors.
"It was felt to be insufficiently sensitive and has led to a loss of confidence in the chairman."
Mr Johnson told BBC News: "This [the letter] has caused huge anger among junior doctors which is the reason, to limit damage to my association and indeed to the cause of junior doctors, that I have decided to resign now."
In a statement to Channel 4 News Mr Johnson said that he wrote the letter to support Sir Liam Donaldson, the chief medical officer, who had come under "unfair attack for failing to give leadership over the MTAS fiasco".
As a civil servant he was not in a position to defend himself, or to "apologise on behalf of the government for what amounts to a failure of policy", said Mr Johnson.
"I wrote the letter to offer a bit of support. I did not consult others because it is not BMA policy to oppose the chief medical officer," he said.
He added: "But this is no ordinary political situation. The medical profession is on the edge."
Jamie Wilson of Remedy UK, which says it has the support of 12,000 junior doctors, said Mr Johnson's resignation had been brought about by the BMA's failure to support the campaign against MTAS.
"This is not about gloating, we hope that as a result of this we can work rapidly towards a system that is fair. The current situation is not acceptable."
Shadow health secretary Andrew Lansley said he was sorry that Mr Johnson had to resign when the blame lay with Health Secretary Patricia Hewitt.
The Department of Health said it was a matter for the BMA.
MTAS ran into serious trouble with many complaining about a lack of posts, poorly designed recruitment forms and technical failures with the online application system.
Mr Johnson said he had intended not to seek re-election in June for a fifth and final year of office, but was leaving early because of "unhappiness" within the BMA.
The BMA said it would now consider the process for electing a new chairman.