The suspect wanted in the fatal shooting of a Massachusetts police officer during a traffic stop was shot and killed after an exchange of gunfire Sunday as authorities closed in on him just seven miles from site of the initial shooting, officials said.

The suspect, identified as 35-year-old Jorge Zambrano, burst out of a closet and opened fire on the officers as they approached him inside a duplex apartment in Oxford, authorities said at a news conference. He was taken to a hospital, where he died.

Authorities said Zambrano had an extenisve criminal history, including charges for drug distribution. WFXT reported that Zambrano had been arrested by Massachusetts State Police within the ast week. 

A Massachusetts state trooper who was wounded in the shootout was hospitalized, but was up and walking later in the evening, officials said. His name wasn't released, but he was identified as an 18-year State Police veteran and a former Navy SEAL.

Zambrano's death ended a manhunt that began approximately 18 hours earlier, when Auburn Police Officer Ronald Tarentino, 42, was shot dead during a traffic stop at about 12:30 a.m. Sunday.

"I'm extremely proud of the work done by every trooper and officer involved in today's investigation and tactical operation," said Massachusetts State Police Colonel Richard McKeon. "My pride is outweighed only by my sorrow for the Tarentino family and the Auburn police, and my concern over our injured trooper."

Tarentino joined the Auburn Police Department two years ago from the Leicester, Mass., department, Auburn Police Chief Andrew Sluckis said. Tarentino leaves behind a wife and three children. 

After the manhunt, officials assured Massachusetts residents that they were safe.

"The threat he (Zambrano) posed to our community is now over," Sluckis said. "We now continue the process of speaking for Officer Tarentino by continuing to investigate all the facts and circumstances of his homicide. We owe his family a thorough accounting of everything that occurred."

State and local police officers lined up outside of the hospital Sunday as a police vehicle, escorted by a procession, took Tarentino's body to the state medical examiner's office in Boston, where the vehicle was met by another large contingent of officers.

Tarentino was the second police officer to die in the line of duty in Massachusetts this year. State police Trooper Thomas Clardy was killed March 16 when his cruiser was struck by another vehicle.

Outside the Auburn police station, the American flag was lowered to half-staff. The town's residents left bouquets of flowers and miniature American flags piled at the bottom of a stone monument dedicated to law enforcement officers who've been killed in the line of duty.

The Associated Press contributed to this report.

Click here for more from Fox 25 Boston.

Click for more from The Boston Herald.