Up to 1,500 junior doctors who were offered posts as registrars have had their job offers withdrawn, following a mistake in the recruitment process.
The Royal College of Physicians, which oversaw the recruitment, apologised, blaming human error. It said the process would have to be re-run.
In a statement, the British Medical Association said it was "appalled".
"We cannot express how unacceptable we find this situation," adding: "This has caused extreme anxiety for trainees."
ST3 Recruitment is a nationally co-ordinated system for recruiting doctors across England, Scotland and Wales into a broad range of specialities.
Last month, after attending interviews, up to 1,500 junior doctors received job offers in 24 different medical fields.
Each candidate was given a score which determined how likely they were to get their choice of hospital and specialty.
Last week, the Royal College of Physicians (RCP) discovered a significant number of candidates were credited with the wrong score, because of an error transferring data from one computer programme to another – and may therefore have received an incorrect job offer.
On Friday, the RCP wrote to all those who had offers, advising them that the offer was being rescinded.
"We are deeply sorry that it has been necessary to rerun the ST3 offer process due to a mistake in this round of processing," states the letter from the RCP.
"We have taken this approach to be fair to all candidates which can only be achieved with the real scores used."
Speaking on behalf of the junior doctors, the BMA issued a statement, lamenting "the impact – both emotionally and financially – it is having on junior doctors across the UK".
Chairs Chaand Nagpaul and Jeeves Wijesuriya said they had spoken at length with Professor Jane Dacre, president of the Royal College of Physicians, "to articulate the strength of feeling".
"We have heard from trainees who have, after receiving these job offers, put down deposits on homes, arranged moves or whose families had adjusted their plans," they said.
"We have conveyed our expectation that college will support and compensate these trainees for any inconvenience."
The statement added that the BMA would be taking legal advice regarding possible breach of contract, and compensation.
The RCP said the error was discovered on Thursday and the college had worked as quickly as they could to identify the nature and extent of the problem.
The offer process is scheduled to begin again on 14 May.
"We appreciate what a worrying time this is for you and will provide as much information as we can, when we can, so you know what is happening," the RCP stated in a letter sent out on Friday.
The RCP added that those doctors who had accepted offers – and made significant plans and commitments based on those offers – would be treated on a case-by-case basis.
"We set the highest standards for our work and expect to be held to them. We have not met them here and are truly sorry," it said.
"We will learn from our mistake and make any changes necessary to fix it."