A man with stab wounds was arrested on suspicion of trying to rape a girl at a Denny’s in Long Beach Sunday, authorities said.

Officers responded to the businesses in the 600 block of Long Beach Boulevard around 1:39 a.m. after getting a call about a sexual assault involving a minor, the Long Beach Police Department said.

A Good Samaritan had noticed what was happening with the girl and sought help. Several civilians then detained the man until officers arrived at the scene, authorities said.

Officers went up to the suspect and found out that he had stab wounds on his body.

The suspect, identified as 33-year-old Jimmie Kirkwood, was then taken to a local hospital for treatment.

“At this time, it is unknown if the suspect sustained injuries during this incident or during an unrelated incident; the investigation to determine how he sustained the injuries is ongoing,” Long Beach police told KTLA in a statement.

Kirkwood was booked on suspicion of lewd and lascivious acts with a child under 14 years old, assault with the intention to commit rape, and false imprisonment, according to police. His bail was set at $100,000.

It’s unclear where in the restaurant the alleged assault took place.

The investigation is underway and no further details were immediately available.