ALBANY, Pa. (AP) – A burglary suspect who fatally shot a sheriff's deputy trying to serve a warrant had left a suicide note days earlier and was dressed in camouflage when he was killed in a shootout with police, authorities said Thursday.

The 25-year-old suspect, Matthew Connor, and Berks County Sheriff's Deputy Kyle Pagerly died in the exchange of gunfire after police arrived at the Albany Township home of Connor's girlfriend Wednesday night with a warrant for his arrest, state police said.

Local and state police and U.S. marshals were trying to arrest Connor for burglary and weapons offenses when he fled into the woods behind the house, according to state police. Pagerly, a member of the sheriff's K-9 team, was part of the search team, authorities said.

Connor raised an AK-47 assault rifle and refused orders to drop it, sparking the shootout, police said. Pagerly, 28, was airlifted to a hospital, where he was pronounced dead. Connor was pronounced dead at the scene.

State police Capt. Dante Orlandi said at a news conference Thursday that family members had found a suicide note from Connor on Monday and handed it over to police. He declined to comment on what the note said.

Connor was wearing camouflage at the time of the shootout and had two guns on him, Orlandi said.

Berks County District Attorney John Adams said authorities were investigating how Connor got the firearms, since he was ineligible to have them due to a prior record. Connor was adjudicated delinquent for a burglary in 2002, Adams said.

Reports said that police were trying to arrest Connor for allegedly shooting a handgun into the ground and threatening his family earlier in the week.

According to court documents, Connor had previously threatened to provoke police into shooting him.

Connor's father told WFMZ-TV the AK-47 belonged to him and his son had taken it. Maurice Connor told the station he is a retired police officer from Cherry Hill, N.J.

Pagerly was an Army veteran who served in Kosovo and Iraq before joining the county sheriff's department in 2006, according to the department's website. Gov. Tom Corbett ordered state flags at the Capitol and state facilities in Berks County lowered to half-staff in honor of Pagerly.

Albany Township is near the Hawk Mountain bird sanctuary in Schuylkill County.

Berks County Sheriff Eric Weaknecht said Pagerly's death was the first fatality in his 27 years in the department.

"Kyle was a great, great person," Weaknecht said. "A family man, a just all-around great guy."