A passenger on an MTA bus in Brooklyn shot another passenger in the hand Friday morning — in front of an NYPD precinct, officials said.

The shooting occurred after a fight broke out between a panhandler and another passenger on board a B12 bus on East New York Avenue in the East New York section of Brooklyn, near the intersection of Thomas S. Boyland St. According to New York Police Commissioner Bill Bratton, the panhandler shot the other passenger in the hand.

But since the incident took place in front of the 73rd precinct stationhouse, the alleged shooter “didn’t get far,” MTA spokesman Kevin Ortiz said. According to Mr. Bratton, an off-duty officer arrested him near the scene.

Carlina Nichols, 27, a department store worker from Brownsville, is pregnant and was on the B12 on the way to the doctor when the shooting occurred. “I was in shock like anybody would be. I never experience anything like this in my life,” he said.