A man suspected of trading heavy gunfire with officers during an hourslong standoff with police at a Florida Panhandle apartment was found dead Tuesday after an armored vehicle approached the apartment, authorities said.

Bay County Sheriff Tommy Ford said that after sporadic bursts of heavy gunfire had pinned several officers down, the vehicle was eventually used to reach the location and a robot searched the residence, confirming the man was dead.

The standoff saw police exchanging gunfire with an assailant shooting from an elevated position with a rifle, Ford said. Several law enforcement agents had surrounded the apartment building and one bystander was hurt, he said. But he added no law enforcement agents were shot or wounded.

“We were just blessed that we didn’t lose multiple officers and citizens today,” Ford said at a news conference disclosing the end of the standoff.

While he called the standoff and gunfire a “nightmare scenario for us,” Ford added, “Luckily none of the good guys were hurt.”

He said a person leaving her apartment was injured and in stable condition. He didn’t give immediate specifics.

Earlier Tuesday, witnesses reported hearing more than 50 shots as the standoff continued for hours in Panama City, where local television reporters were on camera during some of gunfire.

Bay County Sheriff’s spokeswoman Ruth Corley said the suspect had been identified as Kevin Robert Holroyd, but there was no immediate indication of the specific circumstances that led to the standoff and gunfire.

But In neighboring Walton County, the sheriff’s department said on its official Twitter account that the standoff in Panama City was connected with the suspicious death earlier in the day of 30-year-old Clinton Street in Santa Rosa Beach. That agency didn’t elaborate and it was unclear how the two men were connected.

Nearby businesses and schools were evacuated and several police agencies responded during the standoff.

Kim Allagood, owner of a nearby pizza restaurant, said “tons and tons” of police descended on the area and she locked down her restaurant for nearly two hours amid sporadic shooting.

Some initial media reports had suggested the suspect was holed up in bank near the apartment building. However Jeremy King, a spokesman for Regions Bank, said the shooter was not in the bank and he had no information that the suspect was ever inside the bank.

Florida Gov. Rick Scott talked to Bay County Sheriff Tommy Ford about the situation in Panama City. John Tupps, a spokesman for Scott, said the main point of the call was to offer state law enforcement assistance.