Staff shortages forced closures at a quarter of children's wards and more than 40% of baby units at Scottish hospitals, new research has found.

A total of 25% of paediatric inpatient units and 41.7% of neonatal units had to temporarily close to new admissions due to a shortage of medical staff, the Royal College of Paediatrics and Child Health (RCPCH) discovered.

The latest figures, for the year to October 2015, show Scotland's level of children's ward closures is lower than the UK rate of 31.3% but the neonatal closures are marginally higher than the UK rate of 41.1%

The college is calling for the Scottish Government to fund extra trainee doctors to address "gaps" in rotas and help prevent closures.

There are currently 310 paediatric consultants in Scotland and the college wants this to be increased by 84-110 posts if its workforce standards are to be met.

Entry level trainee positions have been full in the past three years but the college's report found "significant gaps" in junior and mid-level paediatric trainee rotas.

The analysis shows 4.4% of paediatric doctors in Scotland qualified to practice medicine in the EEA outside the UK and 19.1% qualified in the rest of the world.

In addition to increasing trainee doctors, the report's recommendations also call on the UK Government to guarantee the migrant status of EU nationals in the NHS and ensure paediatrics remains on the Scottish shortage occupation list.

The report states: "Workforce planning in Scotland must take into account the changing demographics and working patterns of paediatricians by recruiting the right number of trainees to allow for less than full-time working, parental leave and experience in research, education, leadership or overseas medicine."

Provision of acute care in Scotland is "rarely affected by hospital closures", it continues.

Professor Steve Turner, the RCPCH officer for Scotland, said: "Time and again we see rota gaps in paediatric services causing significant strain on the system and these figures show that staffing shortages are leading to service closures all too often.

"This can only be resolved by increasing the numbers coming into paediatrics.

"The number of consultants is increasing in Scotland and between 2013 and 2015 we saw the paediatric consultant workforce grow by more than 13%.

"The target for consultants in Scotland though is for a further 27-35% so there's obviously still a long way to go."

Opposition parties called on the government to tackle the problem.

Scottish Conservative health spokesman Miles Briggs said: "This analysis shows children across Scotland and their families have been provided with a service that's totally unacceptable.

"We've known for some time that there aren't enough trained staff in these wards, yet the Scottish Government appears to have done nothing to address that."

His Scottish Labour counterpart Anas Sarwar said: "This is the reality of the SNP's chronic underinvestment in our NHS staff - patients turned away because hospital units simply don't have the levels of staff required to be able to cope with the demand."

Units in Scotland had to close on average 5.3 times, compared to 3.8 times across the UK, and one Scottish unit reported having to close 39 times.

A Scottish Government spokeswoman said: "Over the last decade this government has helped deliver record numbers of doctors, nurses and other staff across the NHS in Scotland.

"We work closely with boards to support their efforts in staff recruitment. Since 2014 the paediatrics trainee establishment has increased by 8% and fill rates for paediatrics are close to 100%.

"Through our National Health and Social Care Workforce Plan we will continue to strengthen workforce planning practice to ensure a safe and high quality service."