Senate Minority Leader Chuck Schumer was quickly mocked Friday after praising Chief Justice John Roberts of the U.S. Supreme Court for rebuking President Trump’s recent “Obama judges” comment -- while at the same time slamming Roberts’ “partisan decisions.”

“I don’t agree very often with Chief Justice Roberts, especially his partisan decisions which seem highly political on Citizens United, Janus, and Shelby,” the Democrat wrote in a Twitter message. “But I am thankful today that he — almost alone among Republicans — stood up to President Trump and for an independent judiciary.”

Critics on social media and elsewhere pointed out that in issuing a two-sided response to the Trump-Roberts exchange, Schumer was effectively agreeing with the president, who had criticized the courts for partisanship.

Some wondered whether Schumer had even recognized the mistake.

“I wonder if Chuck realizes how he's contradicting himself and proving Trump's point in this statement? I doubt it,” Twitter user Derek Hunter. wrote.

TRUMP SLAMS CHIEF JUSTICE ROBERTS, INSISTS THERE ARE ‘OBAMA JUDGES’

“So Schumer rips the Judiciary as being partisan in the same tweet that he praises Roberts for responding to Trump for criticizing the judiciary as being partisan... Stunning!” another user on social media commented.

Ross Douthat of the New York Times went on to lampoon the Democrat.

“Shorter Chuck Schumer: Trump is totally right about the courts, except when Republican appointees criticize him; then the judiciary is Independent and Good,” the conservative columnist wrote.

Schumer’s backhanded compliment came amid a war of words between Trump and Roberts, with the president criticizing the so-called “judicial activism” of federal judges who halt decisions made by the executive branch, a common occurrence under the Trump administration.

The criticism was prompted after U.S. District Judge Jon S. Tigar, who was nominated by President Obama in 2012 to the U.S. District Court for the Northern District of California, issued a temporary restraining order late Monday against Trump's plan to refuse asylum to immigrants who cross the U.S.-Mexico border illegally if they do not arrive at a port of entry.

“You go to Ninth Circuit and it's a disgrace, and I'm going to put in a major complaint. Because you cannot win, if you're us, a case in the Ninth Circuit,” Trump said. “Every case gets filed in the Ninth Circuit. ... We get beaten, and then we end up having to go to the Supreme Court -- like the travel ban and we won. We're gonna have to look at that.”

"We do not have Obama judges or Trump judges, Bush judges or Clinton judges. What we have is an extraordinary group of dedicated judges doing their level best to do equal right to those appearing before them." — Chief Justice Roberts

In response, Roberts issued a rare criticism of the president.

“We do not have Obama judges or Trump judges, Bush judges or Clinton judges,” he said in a Wednesday statement provided to Fox News. “What we have is an extraordinary group of dedicated judges doing their level best to do equal right to those appearing before them."

Roberts added: “That independent judiciary is something we should all be thankful for.”

But the statement from the chief justice only prompted Trump to double-down on his criticism of the judiciary, saying the courts aren’t as independent as Roberts makes them out to be.

“Sorry Chief Justice John Roberts, but you do indeed have ‘Obama judges,’ and they have a much different point of view than the people who are charged with the safety of our country,” Trump tweeted.

“It would be great if the 9th Circuit was indeed an ‘independent judiciary,’ but if it is why are so many opposing view (on Border and Safety) cases filed there, and why are a vast number of those cases overturned,” Trump continued. “Please study the numbers, they are shocking. We need protection and security - these rulings are making our country unsafe! Very dangerous and unwise!”