(KTLA) — The Los Angeles Police Department is investigating after video surfaced online of a uniformed officer repeatedly striking a man during an encounter.

The incident happened on April 27 in Boyle Heights, police said.

A video apparently recorded by a bystander from across the street shows two LAPD officers, one male and one female, detaining a man on a sidewalk by a church.

Visit KTLA to watch the video.

An initial verbal exchange between the man and the male officer is unclear, but the officer begins striking the civilian at least nine times in the head from behind while screaming expletives. The man crouched down as he asked the officer, “What is wrong with you?”

The attack lasted about 20 seconds, video shows.

The female officer at first stood behind, then apparently placed her hand on her partner’s arm before he could throw another punch.

Police officials said they learned about the “disturbing video” the same day the incident happened, and that the agency “took immediate action.”

According to the LAPD, the two officers responded to the scene after receiving a call about a trespasser. They identified the civilian as the suspect and asked him to leave the property, police said.

LAPD did not say what may have prompted the officer to begin punching the man, only stating that a “physical altercation occurred” between the suspect and the officer.

The officer sustained minor injuries to his hand, while the suspect suffered abrasions to his head and face, LAPD said. The man refused medical care, police said.

As seen in the video, additional officers arrived at the scene.

A member of the community provided a cellphone recording of the exchange to a responding supervisor, LAPD said. A review of that footage, as well as police bodycam video, prompted an internal investigation, the agency said.

Meanwhile, the suspect has been released.

“While we are withholding judgment on the actions of the involved officer at this time, the officer has been assigned home pending further investigation,” the LAPD said in a statement.

The agency said it has also notified the L.A. County District Attorney’s Office, which will monitor the internal probe.

LAPD did not release the identity of the officer or civilian involved.