Health Secretary Alex Neil has told health boards they must end rotas which force junior doctors to work seven nights in a row and more than seven days back to back.
Opposition politicians yesterday welcomed the move. It comes after Brian Connelly, the father of Dr Lauren Connelly who died driving home from a hospital night shift in Greenock, revealed her arduous shift patterns.
The MSPs also said more resources were needed to ensure junior doctors were not over stretched.
Neil Findlay, health spokesman for Scottish Labour, said: "Alex Neil's announcements cannot be seen as a quick fix that will cure all the ills faced by junior doctors in our NHS. They must be backed by resources within our health service that will ensure that junior doctors don't need to be stretched to fill gaps."
Scottish Conservative health spokesman Jackson Carlaw described Mr Neil's announcement as "unexpected" but welcome.
Dr Rosemary Hollick, chair of the Royal College of Physicians of Edinburgh Trainees & Members' Committee, said the "challenging" rotas doctors had to work at short notice had made it difficult to recruit young medical staff.
She said Mr Neil's announcement should improve patient safety, adding: "We hope this signals further work on supporting trainee doctors and making their roles, particularly that of the medical registrar, more attractive to support recruitment."
A Scottish Government spokesperson said: "Under this Government the number of Junior doctors has already increased by 6.3 per cent, which is in addition to the 2,000 extra doctors working in Scotland's NHS.
"Improving the planning of rotas will allow the NHS to make better use of their time."