Charles Krupa/Associated Press Beto O'Rourke at a campaign stop at Keene State College in Keene, N.H., on Tuesday.

Beto O’Rourke, a former Texas congressman and Senate candidate seeking the Democratic presidential nomination, said last week that as president he would suspend capital punishment at the federal level.

But as recently as May 2017, O’Rourke broke with the majority of his Democratic House colleagues to vote for a bill that expanded the federal “list of statutory aggravating factors in death penalty determinations”to include the murder or “targeting” of a law enforcement officer, firefighter or other first responder.

In effect, the bill, called The Thin Blue Line Act, proposed making it easier to execute a defendant if they attacked law enforcement. The legislation is one of a series of bills Republicans have introduced as a political indictment of the Black Lives Matter movement, which has sought to end unjustified police killings of black people.

The measure passed the House with 48 Democratic votes. Four Republicans voted against it.

The bill is far from becoming law. The Senate has not taken it up.

O’Rourke’s stance on the death penalty has evidently changed since 2017. In an interview with Iowa Radio on Thursday, O’Rourke said he was morally opposed to the death penalty and would suspend its use at the federal level as president.

“It’s not an equitable, fair, just system right now ― the guarantees and safeguards against wrongful prosecution, the disproportionate number of people of color who comprise our criminal justice system,” O’Rourke said. “And on moral grounds, I oppose the death penalty.”

O’Rourke has endured scrutiny from some progressives for his apparent shift toward more left-leaning economic views since his time on the El Paso City Council and over the course of three terms in the House.

But O’Rourke has demonstrated a more progressive stance on other criminal justice issues for some time. During his first House run in 2012, he challenged Rep. Silvestre Reyes (D-Texas) from the left on criminal justice, arguing for marijuana legalization. He even entertained full-scale drug decriminalization as a way of de-escalating violence at the U.S.-Mexico border.

The O’Rourke presidential campaign did not respond to requests for an explanation of how or why his views on the death penalty evolved in the past two years.

But HuffPost’s Igor Bobic asked O’Rourke about the 2017 vote while covering his campaign trip to South Carolina on Friday.

“That was a poor decision on my part. I’ve never supported the death penalty,” O’Rourke said.