A California man faces four years in prison for attacking a bar patron who was wearing a red “Make America Great Again” hat in a restroom last year, officials said Wednesday.

David Delgado, 32, pleaded no contest to one count of felony assault by means of force likely to produce great bodily injury, the Los Angeles District Attorney’s Office said in a news release.

FLORIDA MAN WHO SPAT ON 'MAGA' HAT-WEARING BAR PATRON GETS 90 DAYS IN JAIL

The attack happened on Sept. 2, 2019, at a restaurant in downtown Hermosa Beach.

The victim was wearing a red hat with white lettering written in Russian that translated to “Make America Great Again,” a prosecutor said.

FLORIDA MAN ARRESTED FOR ALLEGEDLY SPITTING ON BAR PATRON WEARING MAGA HAT: REPORT

Delgado approached the man and asked him what was written on the hat, police said. After the victim responded, police said the suspect repeatedly punched him in the face.

The victim fell to the ground and Delgado continued to punch him before eventually stealing his hat and fleeing from the restaurant, according to police.

Authorities said they used surveillance footage to identify Delgado and arrest him at his home without incident Oct. 1.

CLICK HERE FOR THE FOX NEWS APP

Delgado is scheduled to be sentenced May 28.

Fox News' Travis Fedschun contributed to this report.