Toxicology services are to receive extra funding to help clear a backlog.
The Crown Office and Procurator Fiscal Service (COPFS) said it would be invested to help speed up overdue post-mortem reports.
Since February, nearly 2,000 reports have been delayed as a result of a staff shortage at Glasgow University, which provides a "significant amount" of toxicology services for the Crown.
The £300,000 will allow the university to hire more staff and buy equipment.
The contract will be taken on by an alternative provider from September 2020.
Lord Advocate James Wolffe has previously said since February, 1859 post-mortem examination reports are recorded as having been held up as a direct result of delays in forensic toxicology analysis.
All sudden and unexplained deaths must be reported to the Crown. Inquiries are then made into the circumstances of the death.
If required, a post-mortem examination is arranged and pathologists use toxicology results to confirm the cause of death and complete post-mortem reports.
Toxicology tests for homicides, road traffic fatalities and child deaths are dealt with first.
The head of COPFS, Crown Agent David Harvie, said: "COPFS appreciate the impact that a delay in confirming the final cause of death can have on those who have lost a loved one.
"We have been meeting with the university to discuss workloads and performance and this significant funding has been allocated to address those issues.
"In addition, COPFS is seeking to secure the future delivery of these services and preserve the valuable contribution toxicology staff make to the investigation of deaths."
A spokesman for Glasgow University said: "We were pleased to conclude an agreement with the Crown Office to provide toxicology services up to September 2020.
"The terms of the contract are confidential, but involve the Crown Office agreeing to pay the full cost of the services provided."