PLAQUEMINE — A Texas man who pleaded guilty to shooting a State Police trooper twice during an Iberville Parish traffic stop last year was sentenced Wednesday to serve 50 years in prison.

State District Judge Alvin Bastiste gave Robert Armendariz, 22, of El Paso, the maximum penalty allowed for attempted first-degree murder of a police officer.

“This was an unprovoked, senseless crime,” said 18th Judicial District Attorney Ricky Ward.

Armendariz was traveling with Fabian Herrera, 21, of Houston, through Louisiana on a business trip from Houston to Biloxi, Miss., on July 3, 2010, when they were pulled over for speeding on Interstate 10 near Ramah, authorities said.

Armendariz refused at first to stop, leading State Police Lt. David Conaway on a brief pursuit, Ward said.

Armendariz eventually drove off the interstate, jumped out of the van he was driving and fired six shots at the trooper, Ward said.

“He unloaded his gun,” Ward said. “It was an ambush.”

Conaway was struck twice in the midsection and arm before Armendariz got back into the van and drove away, Ward said.

Authorities caught the two men a short while later near Henderson, investigators said.

Armendariz, 868 Frogrance Place, El Paso, originally pleaded innocent to the charge, but switched his plea after the state 1st Circuit Court of Appeal upheld a lower court ruling stating that his criminal history could be included during his trial.

Armendariz’s criminal history includes a 2007 robbery charge in El Paso, fleeing a court-ordered stay in a halfway house in the same city and two robberies in Las Vegas, records show.

Prosecutors said Herrera, the passenger in the van during the shooting, had little involvement in the shooting and was “at the wrong place at the wrong time.”

Herrera was sentenced to a year of probation in April after pleading guilty to accessory after the fact to attempted first-degree murder of a police officer.