ROCHESTER, N.H. (AP) — A man who had previously fled from state police in Maine led New Hampshire officers on a car chase and died in a shootout, officials said.

Douglas Heath, 38, was wanted on several outstanding warrants, including one for trafficking narcotics and another for fleeing from Maine troopers, New Hampshire Attorney General Gordon MacDonald said.

Officers spotted Heath's car Monday afternoon and chased him for about 20 minutes before he crashed. Officials said Heath got out of the car, and there was an exchange of gunfire. Heath died at the scene, and a gun was found next to his body, MacDonald said.

Deborah Haynes-Whitehead told WMUR-TV she and her husband were in their truck and first thought they were witnessing a car crash. But then she saw a man with a gun getting out of the car. She said police told him to drop the gun but he didn't, and shots were fired.

"I was thinking about my grandson and whether I'd see him again," Haynes-Whitehead said. "And we slouched down in the truck and just sat and waited for someone to tell us to do something. You know, we were terrified to move the vehicle."

MacDonald said no one else was hurt in the gunfire. He said Rochester police reported last week that they had credible information Heath was staying in in the town, had several guns and had "no intention of going to jail."

MacDonald said two Rochester officers and two state troopers were on the scene at the time of the shooting. It wasn't clear who fired their weapons, or who fired first. All four are on administrative leave.

Maine State Police said Heath was wanted for a June 11 car chase. Maine State Police spokesman Steve McCausland said that Heath, who had ties to Sanford, Maine, and Rochester, led police along route 202 from Sanford to Lebanon, Maine.

Sanford police had tried to pull over Heath's car. McCausland said police knew Heath had an arrest warrant issued for him out of New Hampshire on a drug charge.

McCausland said that police chased the car for a few miles, but stopped because of concern over public safety. He said Heath fled on foot and was likely picked up. Police later tracked down Heath's car to a Lebanon address.

Court records in New Hampshire show Heath had a record dating back to 1997 on charges including misdemeanor trespassing and criminal threatening.