Child and baby units at Scottish health boards have repeatedly been forced to close to new admissions due to staff shortages, a new report has found.
The Royal College of Paediatrics and Child Health carried out a census about services in the year to October 2015.
It found that a quarter of paediatric inpatient units and 41.7% of neonatal units had to close to new admissions due to shortages of doctors or nurses.
The Scottish government said NHS staff levels had increased to a record high.
The workforce report, which was based on a survey of child health services from September 2015 to summer 2016, warned that there was "a shortfall in the paediatric workforce in Scotland".
Scotland's child health facilities include 14 paediatric inpatient units, 15 neonatal units, 17 paediatric outpatient services, 12 short-stay paediatric assessment units, and four hospitals with dedicated paediatric emergency rooms.
Of the 12 paediatric inpatient units which responded to the survey, three had to temporarily close their doors to new admissions due to shortages of nurses and/or doctors during the year before the census date. This total of 25% was less than the UK-wide figure, which was 31.3%.
Of the 12 neonatal units which responded, five had to close their doors to new patients due to staff shortages - the total of 41.7% being similar to the UK-wide figure of 41.1%.
This included one unit which reported having to close to new admissions 39 times in a year - contributing to Scottish units closing on average 5.3 times each, higher than the UK-wide average of 3.8 closures each.
The The Royal College of Paediatrics and Child Health (RCPCH) called on the Scottish government to fund an increase in the number of paediatric trainee places, aiming for an expansion in the consultant-level workforce of 84 to 110 doctors.
The report said: "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."
Prof Steve Turner, RCPCH officer for Scotland, said recruitment was the main workforce pressure facing units - a problem facing health boards across the UK.
He 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."
The Scottish government pointed out that paediatric trainee positions have been almost fully subscribed in recent years, but the RCPCH said there were "significant gaps in junior and mid-level paediatric trainee rotas" across Scotland.
They said there had been a failure to take into account higher instances of part-time working patters in the paediatric workforce, which needed to be "urgently addressed".
The group also highlighted the issue of maintaining the current workforce. With almost 25% of paediatricians having completed their training outside the UK, the RCPCH called on the UK government to guarantee the migrant status of EU nationals working the NHS.
Scottish Labour said the report showed "the scale of staffing problems in our health service after a decade of SNP mismanagement".
Health spokesman 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."
The report comes after Audit Scotland urged the government and health boards to plan ahead better to "urgently address workforce issues".
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."