The government changed the immigration rules in March
Patient safety could be put at risk because changes to immigration rules could force hundreds of junior doctors out of the NHS, a union warns.
The British Medical Association said reform of the tier one skilled migrant category was unfair on foreign medics.
The union said it meant doctors in the first two years of training would not be able to apply for the next stage.
The BMA added that this could lead to a shortage of doctors eventually, compromising safety in the process.
BMA chairman Dr Hamish Meldrum has now written to Health Secretary Alan Johnson urging him to intervene to protect the NHS workforce.
He wants the Department of Health to take up the issue with the Home Office immediately as the NHS is also facing difficulties over the forthcoming introduction of the European working directive for junior doctors.
From August, the scope of the directive will be extended to junior doctors, limiting their working week to 48 hours.
Dr Meldrum said: "The full implementation of the directive coupled with a situation in which a proportion of prospective trainees can no longer continue with their training due to ever-tightening immigration rules is likely to exacerbate rota gaps, putting patient safety at risk.
"The BMA is requesting that the Department of Health intervenes."
The change to immigration rules in March means that those applying for the tier one category, which in the heath service covers junior doctors who have completed the foundation stage of their training and want to move on to specialist training, need to have a master's degree.
But a medical degree - despite being a five-year course - is only classed as a bachelor's, meaning all foreign junior doctors from outside the EU will be excluded.
In his letter, Dr Meldrum pointed out that as well as affecting those doctors who have already started junior doctor training, the thousands of foreign medical students at university in the UK could also end up leaving.
He said workforce planning in the health service was counting on these students becoming NHS doctors over the next few years.
But a joint Home Office and Department of Health statement denied the changes would harm the health service.
It added: "Our Australian-style points based system means only those we need come here to work.
"It is also flexible so we can raise or lower the bar according to the needs of the labour market and the country as a whole."