Senate Majority Leader Mitch McConnell said Tuesday that he would work with President Donald Trump to fill a Supreme Court vacancy should one arise during next year’s presidential election, CNN reports.

The comments marked a reversal from his position in 2016, when he moved to block a nomination by then-President Barack Obama.

The question was posed by an attendee of a speaking appearance at the Paducah Chamber of Commerce luncheon in Kentucky, a video of which was shared on the local WPSD TV website.

“Should a Supreme Court justice die next year, what will your position be on filling that spot?” the attendee asked.

After a pause, McConnell answered, “Oh, we’d fill it.”

Triggering laughter from the audience, he added that doing so would be the best way to ensure a “long-lasting positive impact” in the U.S. and that following the law is “the most important thing we’ve done in the country.”

In March 2016, the senator refused to consider Obama’s nominee, Merrick Garland, when a seat was left vacant following the death of Justice Antonin Scalia. He said then that the Republican-controlled senate would not confirm a nomination until the next president assumed office.

The seat went unfilled until Trump nominated Neil Gorsuch, who was sworn in in April 2017.

McConnell’s comments infuriated Democrats, who were quick to recall his move three years ago.

Senate Minority Leader Chuck Schumer called McConnell a “hypocrite” on Twitter and that McConnell “lives for GOP judges” because he sees control of the courts as the only way Republican agenda can be achieved.

Democratic presidential hopeful Julian Castro called his “shamelessness at stealing a Supreme Court seat” is “appalling.”

Write to Hillary Leung at hillary.leung@time.com.