The laboratory is due to open in December 2022, meaning toxicology services will transfer from Glasgow University to the Scottish Police Authority Forensic Services (SPA FS).
The Scottish Government says staff will be retained during the move.
In January last year, opposition MSPs hit out at the Government over delays to post-mortem examination results being returned to families.
Scottish Labour said more than 2,000 families had been affected by the backlog, with some waiting up to nine months to find out why their loved ones died.
SPA FS will provide sample testing for the Crown Office at the new facility in the central belt, as part of its duty to investigate unexplained deaths.
Justice Secretary Keith Brown said: “I welcome this investment to provide a new state-of-the-art facility which will allow essential post-mortem toxicology services to continue, ensuring that the (Crown Office) continues to meet its obligations to investigate all sudden, unexplained deaths.
“This investment also enables significant operational efficiencies to be delivered, with the new service benefitting from specialist scientific instruments and supplies in a purpose-built laboratory.”
Lord Advocate Dorothy Bain QC said: “This change secures the future of a service that is vital for the investigation of unexplained deaths.
“I would like to thank the University of Glasgow for their hard work over the years, and I am delighted that their expert staff will be retained in the transition.”