An investigation has found young doctors routinely clock up more than 87 hours per week even though the UK has adopted rules that state staff should work no more than an average of 48 hours unless they choose to do so.
But rotas imposed by many health boards mean doctors are clocking on for an entire week of back-to-back shifts of at least 12 hours.
The British Medical Association (BMA), which represents junior doctors north of the Border, warned that although the shift patterns did not breach the European Working Time Directive (EWTD), they went against its spirit.
Dr David Reid, chairman of the BMA's Scottish Junior Doctors Committee, said: "If you were a patient you would not necessarily want to be treated by someone who has been rotared for 90 hours, who is coming to the end of a seven-day run of long shifts."
NHS managers are allowed to do this within the law as long as they can show average working patterns are below 48 hours per week over a period of six months.
All Scottish mainland health boards, with the exception of NHS Lanarkshire, provided details about the hours worked by junior doctors under freedom of information legislation, as requested by The Herald as part of our NHS Time For Action campaign.
Ayrshire and Arran, Fife, Forth Valley and Grampian and Lothian roster some doctors to work 87 hours or more a week. In Ayrshire, the maximum working week is 91 hours, comprising seven consecutive day shifts of 13 hours.
Tayside also indicated junior doctors were working a 91-hour week until this summer, when the maximum dropped to 71 hours. Other boards had more reasonable shift patterns, though five out of 11 health boards admitted junior medics still work seven nights in succession.
Dr Reid described 85 to 90-hour weeks as exhausting, adding: "It is not just the time you spend at work. By the time you get home after a 12-and-a-half hour shift you cannot just switch off, you need time to unwind. Particularly on night shifts, you do build up a sleep deficit as the week goes on."
Dr Reid said: "There is really good evidence that you make more mistakes if you are working a lot of night shifts in a row and become more fatigued. If some of the biggest health boards in Scotland can sort this out, I am sure the others can do that too."
The BMA has gathered evidence that medical errors, including incorrect diagnoses, increase exponentially over the course of one night-shift and even more over consecutive night-shifts.
Last week, the largest study of its kind in Scotland revealed 8.5% of prescriptions written by junior doctors in their second year after graduation contained a mistake. When researchers asked staff about the causes of their errors they cited workload, time pressure, tiredness and stress as key issues. Ian Ritchie, president of the Royal College of Surgeons of Edinburgh, said: "It is disappointing that after so many years of the New Deal and European working-time regulations we still have junior doctors working very long hours when we know that is not the safest thing to do."
He noted the NHS has had to cope with many major changes and that consultants who used to work 100-hour weeks felt there had been improvements.
Mr Ritchie called on medical colleges, NHS chiefs and the BMA to consider what training experience they wanted to offer the next generation of doctors.
Ayrshire and Arran said it was reviewing rotas to ensure that training, well-being and patient safety were not compromised. A number of health boards pointed out only a small number of rotas entailed taxing shift patterns and that doctors were given time off following an intense period of shifts.
Boards also stressed they fully complied with the EWTD and "New Deal" rules, which cut working hours for junior medics in the UK before the European law became mandatory.
Leader comment: Page 14