Doctors say the Scottish Government must act now to address staffing problems in the NHS after figures showed 377 consultant posts are lying vacant - with almost half these posts empty for at least six months.

The British Medical Association (BMA) called on ministers "to find a way to attract more doctors to work in Scotland and to fill vacant posts to ensure that the NHS continues to deliver a high-quality and sustainable health service".

Medical leaders issued the plea despite official figures showing a record number of staff working in the health service in Scotland.

At the end of December 2016, there was the equivalent of 139,262 full-time workers employed by the NHS, an increase of 0.7% on the previous year and 9.6% higher than the total a decade ago.

For consultants, there was the whole time equivalent (WTE) of 5,170.3 in place in December 2016 - up by 88.2 on the previous year and 1,545.7 higher than in September 2006.

Nursing and midwifery staff increased to 59,709.1 WTE by the end of last year, an increase of 421.7 from December 2015.

At the same time, 4.1% of nursing and midwifery posts were vacant - the equivalent of 2,525.5 full-time posts - compared to a vacancy rate of 3.6% at the end of 2015.

By the end of December 2016, there were 736.5 WTE nursing and midwifery jobs that had been left with no-one in post for three months or more.

For consultants, the latest figures showed a vacancy rate of 6.8% - 377 WTE posts, with 180.9 of these having been vacant for at least six months.

Simon Barker, chair of BMA Scotland's consultant committee, said: "It is not enough for the Scottish Government to create extra consultant posts, they must be filled too.

"With vacancies increasing and demand rising faster than we are able to resource it, more needs to be done to ensure proper workforce planning to address current gaps and plan for future needs.

"The fact that almost half of all medical consultant vacancies have been vacant more than six months highlights the difficulties that some specialities are experiencing in recruiting and retaining doctors.

"Despite repeated advertising, these gaps are not being filled and this is causing unrelenting pressure on those doctors currently working in the health service."

Labour health spokesman Anas Sarwar claimed the SNP government was "completely detached from reality about the crisis in the NHS workforce".

He said: "While government ministers demand praise for their record, hundreds of posts have been lying vacant for months in our health service.

"It is abundantly clear to everyone apart from SNP ministers that our health service does not have the staff it needs to deliver the care patients deserve.

"This is the result of ten years of SNP mismanagement of our health service."

Health Secretary Shona Robison said: "Under this government, NHS staff numbers have risen to record highs - with more consultants, nurses and midwives now delivering care for the people of Scotland.

"There are now 12,200 more staff working in our NHS, with nearly 1,000 of these recruited in the last year.

"These extra staff will ensure people all across Scotland get the high-quality NHS services that they rightly expect.

"We are also committed to preparing our NHS workforce for the future by increasing student nursing and midwifery intakes for five consecutive years.

"That's helped to see almost 10,000 nurses and midwives in training in 2015."