A 21-year-old burglary suspect was in critical condition Monday after being shot by a resident in a Bensalem apartment building, police said.

Officers responded to the Franklin Commons Apartments on Bobolink Drive about 8:35 p.m. Sunday after a woman reported that a man had broken into her second-floor apartment and was masturbating on the deck, Bensalem police said.

The woman called 911 and fled to a neighboring apartment, while the man jumped out of a second-floor bedroom window and entered another apartment, police said.

The suspect, identified as 21-year-old Angel Suarez Medero, allegedly assaulted two people inside that apartment and was shot twice by one of the tenants. The Philadelphia Daily News reported that Suarez Medero is a successful jockey who raced often at Parx in Bensalem.

Police said the struggle between the resident and Suarez Medero continued until the suspect was subdued by responding officers. Suarez Medero was taken to Aria-Torresdale hospital in critical condition. He was expected to be charged with burglary, assault, and other offenses. Authorities said the investigation is continuing.