By Amy Worden and Allison Steele

Confronted by a gunman just blocks from the state Capitol, a legislator from Northeastern Pennsylvania pulled his own weapon and traded fire with a would-be robber.

No one was hurt in the Tuesday night shootout, and police arrested four teens and charged them for their alleged roles in the attempted street robbery.

But the firefight had the Capitol buzzing on the last day of its legislative session and underscored the difference between life in the golden dome and the gritty city that surrounds it.

Rep. Marty Flynn (D., Luzerne), a former corrections officer, mixed-martial-arts fighter, and professional boxer, who has cosponsored gun-safety seminars around the state, traded fire with the gunman after he and Rep. Ryan Bizzarro (D., Erie) were stopped on their way back to their Harrisburg residence after a fund-raiser and dinner.

"I was just shooting to survive, just to protect myself and my friend," Flynn, 39, told reporters.

It was about 11 p.m. when Flynn and Bizzarro -- both first-term lawmakers up for reelection next month -- were walking on the 200 block of Herr Street and Flynn sensed someone behind them. When he turned, he saw a teenager brandishing a gun, a bandanna covering the lower half of his face.

"It was like the devil in the night," Flynn said.

The teenager demanded their wallets, but Flynn said they didn't have anything.

Flynn said he had a .38 Smith & Wesson strapped to his back in a holster. As he started to reach for it, he said, he heard another teenager yell a warning from across the street, and he stopped.

Bizzarro then made a movement toward his pocket, and the gunman fired at him, Flynn said.

"I knew he meant business," the legislator said. "It was him or Bizzarro."

Flynn said he drew his gun and fired twice before the lawmakers and assailants fled in different directions. Bizzarro and Flynn made it back to their residence and called 911.

Flynn told a responding police officer that he had fired his gun and handed over the weapon, which he owns legally.

Three suspects were caught within minutes a few blocks away, Harrisburg police said Wednesday. A fourth was arrested early Wednesday at home.

Charged were Jamani Ellison, 17; Jyair Leonard, 15; Derek Anderson, 17; and Zha-quan McGhee, 15, whom police identified as the shooter. He was charged with attempted homicide, aggravated assault, and carrying a firearm without a license. The other suspects face charges of conspiracy and robbery. They will be prosecuted as adults, police said.

Police believe the four were also responsible for the gunpoint robbery of three employees of the House Republican Campaign Committee at the base of the Capitol steps Monday night, Harrisburg police said.

Violent crime is not a rarity in the state capital. Last year, 349 robberies were reported in Harrisburg, which meant the city of about 49,000 had a robbery rate more than four times higher than the rest of Dauphin County, according to state police statistics.

Bill Patton, a spokesman for the House Democrats, reminded lawmakers Wednesday that they could call security if they wanted to be walked to their cars. Steve Miskin, spokesman for the House Republicans, said GOP caucus leaders were advising their members not to walk the streets of Harrisburg at night.

"It seems to be more dangerous," he said.

State Rep. Jaret Gibbons (R., Beaver) was assaulted in a parking lot last year, Miskin said, and there have been holdups involving several staff members, including a staffer with the House Democratic Committee, who was mugged last month in the same area.

In 2010, Rep. Tim Solobay (D., Washington) fought off armed robbers who assaulted him outside the Capitol.

The assault on Flynn and Bizzarro came as the state Senate was poised to debate a bill that would make it harder for local municipalities such as Harrisburg to enact local gun laws. It would give standing to gun-rights groups such as the NRA and would force municipalities to pay legal costs regardless of the outcome of a trial.

(c)2014 The Philadelphia Inquirer