An illegal immigrant from Mexico was sentenced to 70 months in prison after attacking a Border Patrol agent with a flashlight earlier this year, the Justice Department said Monday.

Melecio Lopez-Hernandez, 39, encountered a Border Patrol agent in the brush near Freer, Texas, on Feb. 7. The agent tried to detain him but Lopez-Hernandez struggled, grabbed the agent's flashlight from his vest, verbally threatened him and then hit him in the head with the light, according to the Justice Department.

The agent sustained injuries and Lopez-Hernandez was arrested. He pleaded guilty on April 30.

GIRL FOUND DEAD IN SUITCASE IN TEXAS 3 YEARS AGO MAY HAVE BEEN FROM ARIZONA, OFFICIALS SAY

"At the hearing, the defense attempted to convince the court [Lopez-Hernandez] thought the officer was a cow and was startled when he appeared," the Justice Department said. "[U.S. District] Judge [Marina Garcia] Marmolejo was not persuaded."

ANGEL MOM WHOSE SON WAS KILLED BY ILLEGAL IMMIGRANT CLAIMS FACEBOOK IS CENSORING HER POSTS

Lopez-Hernandez is expected to face deportation proceedings after serving his sentence. He will remain in custody pending transfer to a U.S. Bureau of Prisons facility.

Freer is roughly 63 miles northeast of Laredo, which sits on the Texas-Mexico border.

CLICK HERE TO GET THE FOX NEWS APP