Tayside sought the biggest loan of £2.8m, followed by Highland (£2.5m) and Orkney (£700,000), after their budgets burst before the end of the financial year on April 5. In addition, NHS 24, the advice and information line, has sought £3.9m which is on top of £16.6m it received from ministers in 2012/13.
NHS Highland has sought the money to plug the hole in its finances as it struggles to fill consultant vacancies and faces a rising bill for drugs. But the cash will have to be repaid in future years at the same time as spending is brought within budget, raising the possibility of cuts in order to break even.
Nick Kenton, NHS Highland director of finance, said: "The need to obtain brokerage is clearly disappointing and emphasises the need for robust savings plans and controls which deliver recurrent savings and reduce the health board's reliance on non-recurrent resource."
Its most significant overspend relates to Raigmore Hospital in Inverness, which has burst its budget by £9.5m.
Garry Coutts, chairman of NHS Highland, said the rising cost of drugs for complex conditions, including cancer, the need for extra clinics to make sure patients are seen within waiting times targets and the need to hire locums had all contributed.
He said the loan meant the board could avoiding cutting patient services and he was confident they could reap the money back over the next few years.
A Government spokesman said: "We expect all health boards to manage their finances within their allocated resources and they must prioritise in order to provide high-quality services for patients. However, on some occasions, some boards may require additional resources within that financial year to deal with specific financial pressures. Where this does happen, a clear plan is put in place for health boards to repay the funding over subsequent years to ensure long term financial balance."
The loans represent less than 0.1% of the total NHS budget.