NHS Scotland filled more than 1,000 medical training posts in 2019
More than 90% of medical training posts advertised in Scotland in the last year were filled, according to NHS statistics.
Data from NHS Education for Scotland showed that only 89 of 1,131 positions (8%) were not take up in 2019.
Although the number of available posts has fallen each year since 2016, the percentage filled and the number of trainees are at a five-year high.
There were 37 medical specialties in which every place was taken.
The figures show that the number of people applying to specialise in general practice has increased by 21%, with 325 posts filled from the 340 advertised - 33 more than in 2018.
Health Secretary Jeane Freeman said: "I am delighted that Scotland's frontline healthcare will see the highest number of trainee GPs in post since 2015.
"This continues to reflect Scotland's reputation as a country with a first-class medical education system with flexible training opportunities for our junior doctors."
She added: "It is particularly encouraging to see more GP trainee posts filled in previously hard-to-fill locations thanks to our GP Specialty Training Bursary."
Ms Freeman said she recognised there were "ongoing challenges" in recruiting to certain medical specialities and in some areas of the country.
'Best possible training'
She said the number of undergraduate places would increase by 22% by 2020/21.
Prof Rowan Parks, medical director of NHS Education for Scotland, said: "This is a great tribute to the hard work of consultants and general practitioners across the whole of Scotland, who continue to ensure that doctors training here have a great experience and the best possible training.
"We welcome the continued improvement in fill rates for training posts across Scotland this year.
"There are many challenges, but everyone involved is working hard to ensure the most attractive and highest quality training environment for Scotland's junior doctors."
In August, the public spending watchdog Audit Scotland said plans to increase the number of GPs faced "significant challenges".
Audit Scotland said the government would struggle to meet its commitment to recruit an extra 800 family doctors over the next decade.