A judge has sentenced an illegal immigrant who attempted an unauthorized crossing of the U.S.-Mexico border to five years for assaulting a Customs and Border Patrol (CBP) guard.

Mexican Melecio Lopez-Hernandez, 39, claimed he thought the border patrol agent was a cow and therefore the assault was unintentional, Texas NBC affiliate KVEO reported Monday.

According to KVEO, Hernandez was trying to enter the United States by sneaking through a sagebrush covered area south of Freer, Texas. A border patrol guard saw the migrant attempting to cross the border and went over to detain him. A brief struggle ensued with Hernandez prying the guard’s flashlight from his vest.

Hernandez first threatened the border agent then used the flashlight to hit the guard. (RELATED: Ocasio-Cortez Screamed At Federal Law Enforcement Agents ‘In A Threatening Manner’ While Visiting Border)

Assaults against CBP agents are hardly uncommon. Since Oct. 1, 2018, over 600 guards have been victims of assault. CBP Chief Carla Provost told CBS 4 News that this figure is “unacceptable.”

Although the numbers of illegal migrants is on the decline, it has been a busy year for the CBP agents. At the end of April, New Mexico guards netted 424 migrants trying to enter the U.S. — the operation was described as the “largest” single arrest in the agency’s history.

The guards have also had to endure criticism from politicians like New York Democratic Rep. Alexandria Ocasio-Cortez who called the immigration detention centers “concentration camps” and had to refute her claims that detainees were drinking toilet water.