Governor Deval Patrick named a prominent former prosecutor Thursday to lead a team of law enforcement officials and defense lawyers marshalled to investigate fears of widespread tampering at a state drug laboratory.

That announcement came shortly ­before two men were freed from prison because of concerns that evidence in their cases may have been tainted at the Jamaica Plain lab by a chemist who handled 60,000 drug samples during nine years.

David Meier, Patrick’s choice to lead the investigation, said he would approach the daunting task not as a prosecutor, ­defense attorney, or judge, but “as an ­advocate for fairness and due process on behalf of the criminal justice system.”

“The job of the office is to make sure no one falls through the cracks,” Patrick said at a Beacon Hill press conference with Meier, who spent 20 years as a ­Suffolk County prosecutor ­before entering private practice.

Get Fast Forward in your inbox:

Forget yesterday's news. Get what you need today in this early-morning email.

If widespread tampering is confirmed, law enforcement ­officials and defense attorneys have said, thousands who were convicted of drug crimes or pleaded guilty to reduced charges to avoid long prison terms may be released early.

Attorney General Martha Coakley’s office, which had begun an investigation of Dookhan’s actions, said Thursday that it would expand its inves­tigation of the drug analysis unit at the lab. That review will focus on cases beyond those handled by Dookhan and will hire independent forensic experts to guide the inquiry.

“Our review is focused on whether any failures at the laboratory impacted the reliability of the results on cases beyond those handled directly by the chemist,” a top Coakley aide said in a letter to the Massachusetts District Attorneys Association and the Committee for Public Counsel Services, the public defender agency.

The consequences of the unfolding scandal were evident in Dedham Thursday, where ­David Danielli and Mark Troisi were released by judges with the backing of Norfolk District Attorney Michael Morrissey’s office. Prosecutors concluded drug evidence in the cases was so compromised by Dookhan’s alleged mishandling that they could not ethically support the continued imprisonment of Danielli and Troisi.

According to court records, Danielli pleaded guilty to drug possession this year after ­Quincy police in 2011 found 500 suspected oxycodone pills in a fake aerosol bottle in his car. Dookhan in June 2011 tested the pills, among 90 batches of samples initially identified as being mishandled by the chemist. State Police have since concluded she may have tainted drug samples dating to 2003, and the release of Troisi falls ­into that class of cases.

Dookhan tested those drugs in 2010, according to records. In January, Troisi pleaded guilty to drug charges and was sentenced to five years and one day in state prison. In court ­papers asking for Troisi’s release, defense attorneys said prosecutors notified them that Dookhan handled the evidence, and it was now “irreparably tainted.”

On Thursday, Superior Court Judge Kenneth Fishman vacated the guilty plea and ­allowed Troisi to walk out of the courthouse.

Both men still technically face charges, but cases relying on Dookhan-tested evidence are expected to unravel.

David Traub, a spokesman for Morrissey, said prosecutors are awaiting results from the Coakley’s criminal investigation before making a final decision in Dookhan-related cases. But until that investigation is complete, Traub said, “If we don’t have evidence, there shouldn’t be a liberty issue.’’

Patrick declined to answer directly at the press conference whether he is concerned about prisoners committing new crimes if released early.

“The general public wants justice to be done in given cases,” he said. “That means the ­evidence has got to be solid. It’s got to stand up. And in cases where the evidence doesn’t stand up, our system is about dealing with that.”

For 12 years, Meier was chief of the homicide unit under Suffolk District Attorney Daniel F. Conley and Conley’s predecessor, Ralph C. Martin II. He was instrumental in freeing two men wrongfully convicted of murder: Donnell Johnson, imprisoned for killing 9-year-old Jermaine Goffigan in 1994, and Marlon Passley, imprisoned for the 1995 murder of 18-year-old Tennyson Drakes.

Once those men were freed, Meier prosecuted suspects whom authorities concluded had actually committed the crimes.

According to the Patrick administration, Meier’s staff will collect information regarding potentially affected cases from the Department of Public Health, courthouses, and the state departments of correction, parole, probation, and youth services, along with the US Bureau of Prisons and the US attorney’s office for Massachusetts.

Meier’s team will compose a master list of suspects and convicts whose cases may have been involved and provide that roster to defense attorneys and prosecutors.

Meier will be paid $12,500 a month, the same as a Cabinet secretary. It is not clear how long his job will take, but ­Patrick said he expects the state will need to hire paralegals and other support staff and will need to seek additional funding from the Legislature.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.