ST. PETERSBURG, Fla. -- Authorities and a fugitive holed up in an attic fired more than 100 shots at each other Monday in a firefight that killed two officers, wounded a deputy U.S. marshal and led to an hourslong standoff that ended when the suspect was found dead inside the home.

St. Petersburg Police spokesman Michael Puetz said the suspect was found dead when officers went into the home Monday afternoon, about six hours after the shootout, the latest in a recent rash of shootings across the nation that have killed or wounded law enforcement officers.

Law enforcement had been at the home to arrest Hydra Lacy Jr., 39, around 7 a.m. on an aggravated battery charge, and investigators believe he is the one who opened fire on the officers, Puetz said.

He said Lacy had a long record that includes convictions for armed robbery and sexual battery.

He had been listed as a sex offender with the state since 1996 and failed to register in December with the Pinellas County Sheriff's Department, which he was required to do four times a year.

Deputies had been looking for him since then, and local officers on Friday had been told to be on the lookout for Lacy.

"He was somebody we wanted to get off the streets, " Police Chief Chuck Harmon said. "Who expects to walk into a house and get gunfire from the attic?"

The marshal was shot twice but was doing fine, Chief Deputy U.S. Marshal Tom Figmik said.

One officer, the marshal and a Pinellas County Sheriff's deputy were the first ones at the house and were told by a woman that Lacy was in the attic. The three called for backup, and soon after

Jeffrey Yaslowitz, 39, and Tom Baitinger, 48, arrived. Police had initially said they were among the first three to arrive.

The chief said Yaslowitz and the marshal, who was not identified, went up to the attic and exchanged fire with the suspect. Both were hit. Yaslowitz went down in the attic, while the marshal tumbled to the first floor after being hit in his bulletproof vest and lower torso.

Baitinger was one of several officers who came to rescue the other two and was hit when Lacy fired through the attic floor.

Hostage negotiators arrived, and the SWAT team exchanged more gunfire with the suspect. The SWAT team eventually got Yaslowitz out of the house, destroying about a third of the home in the process. He was later pronounced dead. Authorities had tried to force out the gunman by cutting off the home's electricity and water before discovering he was dead.

Baitinger had worked with the department since 1996 and is survived by his wife. Yaslowitz started his career there in 1999, working with a K-9 unit and his dog partner, Ace. He is survived by his wife and three children.

"In my mind as a police officer, this crook, this criminal, this murderer, cop-killer, whatever you would like to call him, did a terrible injustice to two of my people today and two of the people that served this community," Harmon said during an afternoon press conference.

The home, situated in a middle-class neighborhood on the south side of St. Petersburg, was listed in Lacy's name, according to property records.

Court records show Lacy failed to show for his scheduled trial Nov. 1 on the aggravated battery charge, and an arrest warrant was issued the next day.

State records show Lacy was convicted in 1989 of armed burglary, resisting arrest with violence and other charges. He was released from prison 1991. In 1992, he was convicted of sexual battery with a weapon or force and false imprisonment of a child. He was released in from prison 2001.

Monday's shooting comes four days after two Miami-Dade County detectives were killed by a murder suspect they were trying to arrest. That suspect was killed by another detective.

The officers were being remembered Monday at a funeral, where news of Monday's shooting added to the grief already palpable among the thousands gathered at American Airlines Arena in downtown Miami.

On Sunday, a man opened fire inside a Detroit police precinct, wounding four officers including a commander before he was shot and killed by police. The officers' injuries were not considered life-threatening, said Police Chief Ralph Godbee.

And on Monday, a Lincoln City, Ore., police officer was critically wounded when he was shot during a traffic stop.