A man recorded himself being shot in the leg by a Los Angeles synagogue security guard and posted the video on YouTube, police said.

The man was recording the armed guard at the Etz Jacob Congregation in the Fairfax neighborhood at about 12:20 p.m. local time Thursday, an LAPD spokesperson said.

The video shows the guard standing behind a gate at the facility holding a pistol before the shooting.

He shouts at the man recording him to back away, then raises the gun and shoots him once in the leg, video shows.

“F—er shot me!” the victim yells after the shooting, according to the video.

The victim was transported to a local hospital conscious and breathing, the police spokesperson said.

The security guard was detained and no suspects are outstanding, police said.