WASHINGTON — At his campaign rally last month in Tulsa, Okla., President Trump ranked his Supreme Court appointments among his biggest achievements. “Two great Supreme Court judges!” he boasted. “So, we have two justices of the Supreme Court, Justice Gorsuch, Justice Kavanaugh, they’re great. They are — they’re great.”
He might not have felt so warmly on Thursday after Justices Neil M. Gorsuch and Brett M. Kavanaugh categorically dismissed his claim to “absolute immunity” from investigators seeking his tax returns. In a pair of far-reaching rulings, Mr. Trump’s two appointees joined a unanimous conclusion that the president went too far by pronouncing himself exempt from legal scrutiny.
The forceful decisions represented a declaration of independence not only by Mr. Trump’s own justices but by the Supreme Court as an institution, asserting itself as an equal branch of government in the Trump era. No matter how often Mr. Trump insists that he has complete authority in this instance or that, the justices made clear on Thursday that there were in fact limits, just as they did in landmark executive power cases involving Presidents Richard M. Nixon and Bill Clinton.
That a conservative court including two of his own appointees would so decisively slap down a Republican president’s expansive claim of constitutional power served as a reminder that institutional prerogatives still matter in Washington, even in a time of extreme partisanship. The court remains broadly conservative on important issues like religious freedom, but in cases on gay rights, immigration, abortion and now executive power, it has defied the president repeatedly in recent weeks.
By forging a unanimous consensus on Mr. Trump’s immunity claim, Chief Justice John G. Roberts Jr. seemed to underline the point he made two years ago when he rebuked Mr. Trump by saying there were no “Obama judges or Trump judges.” Even on the overall votes on the two cases, both decided 7 to 2, he brought together four liberals and three conservatives, echoing the firm lines drawn by the court against other overreaching presidents.
“The truth is, President Trump’s arguments for immunity were so sweeping that it was almost impossible for any justice to really embrace them,” said Tom Goldstein, a prominent Supreme Court litigator and the publisher of Scotusblog, a website that tracks the court.
Still, the justices cut Mr. Trump a break by sending the two cases back to lower courts to consider the merits of the subpoenas according to standards set by the court, additional litigation that will most likely keep his tax returns shielded from public view through the general election on Nov. 3.
Many legal experts predicted that Mr. Trump ultimately could still stave off congressional demands for his returns because the justices in Trump v. Mazars USA seemed dubious about their legitimacy and put the onus on the House to justify its need for the documents. But experts said Mr. Trump was likely to eventually lose the effort to block a New York prosecutor because the justices in Trump v. Vance put the burden on the president to come up with a compelling rationale for why the returns should not be turned over.
The president lashed out on Twitter minutes after the court’s rulings, once again presenting himself as a victim. “This is all a political prosecution,” Mr. Trump wrote. “I won the Mueller Witch Hunt, and others, and now I have to keep fighting in a politically corrupt New York. Not fair to this Presidency or Administration!”
“Courts in the past have given ‘broad deference,’” he added. “BUT NOT ME!”
In fact, Mr. Trump was the one seeking special treatment. Every president since Jimmy Carter has voluntarily released his tax returns, but Mr. Trump has refused since 2015 when he began running for the White House and said he was being audited. While he promised to make them public once the audit was over, he never has.
Five years later, the White House said on Thursday that he was still being audited but did not identify which years of tax returns were being reviewed. Once in office, every sitting president’s returns are audited automatically, so if that remains his standard, he presumably will never release them voluntarily.
Similarly, Mr. Trump was seeking court protection beyond that enjoyed by any other president, claiming “absolute immunity.”
That flew in the face of the principles set by the court when Mr. Nixon in 1974 lost his bid to shield tape recordings that implicated him in the Watergate cover-up. In that case, U.S. v. Nixon, the court ruled against the president 8 to 0, including three of his appointees, Chief Justice Warren E. Burger and Justices Harry A. Blackmun and Lewis F. Powell Jr. A fourth appointee, Justice William H. Rehnquist, recused himself because he had served in Mr. Nixon’s Justice Department.
Twenty-three years later, the court rebuffed Mr. Clinton’s immunity claim while in office against a sexual harassment lawsuit brought by Paula Jones, a former Arkansas state worker. Both of Mr. Clinton’s appointees, Justices Ruth Bader Ginsburg and Stephen G. Breyer, rejected his position in the 9-to-0 decision in that case, Clinton v. Jones.
Like his predecessors, Mr. Trump was unhappy with the rulings, although aides sought to calm him by assuring him that he could continue fighting in lower courts. But he expressed deep anger at Justices Gorsuch and Kavanaugh, seeing their votes as a betrayal, according to a person familiar with his reaction.
But the two justices only followed in the footsteps of their predecessors by rejecting the president who put them on the court. While each of them has generally sided with Mr. Trump since taking office, in this case they drew a line. Neither is personally close to Mr. Trump nor is either thought to be much of an admirer of the president, so some saw the decision as a way to distance themselves.
“My guess is their feeling about him is, ‘We intend to be on this court long after he is a bad memory, and if his administration is about to come crashing down, we might as well have been people who weren’t willing to completely blow up the Constitution for him,’” said Richard Primus, a constitutional scholar at the University of Michigan Law School, adding that they would do so only if they also saw it as “the right legal answer.”
Mike Davis, who as a congressional aide helped confirm both of Mr. Trump’s justices and now leads the Article III Project to support his other judicial nominees, said the president should not be too disappointed in his appointees.
“I would say, ‘Mr. President, you appointed judges, not puppets, and they’re going to follow the law and it doesn’t matter who appointed them,’” Mr. Davis said. “Despite perceived setbacks here and there, President Trump’s transformation of the federal judiciary is his biggest accomplishment.”
Kayleigh McEnany, the White House press secretary, said she did not ask Mr. Trump specifically for his reaction to the position taken by Justices Gorsuch and Kavanaugh, but insisted that “his justices did not rule against him.”
Like the president’s other aides, she focused on the fact that the court sent the cases back to lower courts for further proceedings with standards for Mr. Trump to meet if he wants to avoid subpoenas, and she cited cautions in the ruling against fishing expeditions. “That language made it pretty clear that this was a win for the president,” Ms. McEnany said. “The justices did not rule against him.”
In a concurrence in the New York case, joined by Justice Gorsuch, Justice Kavanaugh flatly dismissed Mr. Trump’s constitutional argument. “In our system of government, as this court has often stated, no one is above the law,” he wrote. “That principle applies, of course, to a president.”
But he added that “a court may not proceed against a president as it would against an ordinary litigant,” and so state prosecutors must still justify their demands for documents like his tax returns. He said he would apply the same standard articulated in the Nixon case, that prosecutors have to provide a “demonstrated, specific need” for the information, a formulation that Chief Justice Roberts did not adopt in his majority opinion.
Justice Kavanaugh’s position perhaps should not come as much of a surprise. While known as an advocate of executive authority, he expressed reverence for the Nixon ruling during his confirmation hearings in 2018, calling it “one of the greatest moments in American judicial history.”
“I would say all the people who opposed Kavanaugh on the grounds that he somehow believed in an imperial presidency and thought the president is above the law ought to reconsider and apologize for how incorrectly they read his past,” said Carrie Campbell Severino, the president of the Judicial Crisis Network, a group that supports conservative judicial nominees. “This is totally consistent with what he’s said before.”
Liberal activists, however, were hardly rushing to give him much credit. “The claim of absolute immunity was too far out there to endorse with a straight face,” said Brian Fallon, the executive director of Demand Justice, a progressive group fighting Mr. Trump’s judicial nominations. “It is hardly reassurance about the types of justices that Kavanaugh and Gorsuch are.”
Justices Gorsuch and Kavanaugh have been supportive of the Trump administration, but not across the board. Justice Kavanaugh has voted for the position espoused by the administration 67.6 percent of the time, making him the second-most reliable ally behind Justice Samuel A. Alito Jr., according to figures compiled by Adam Feldman, a statistician for Scotusblog. Justice Gorsuch has agreed with the administration’s point of view 56.1 percent of the time, making him fifth, behind Justice Clarence Thomas and Chief Justice Roberts.
Justice Gorsuch has broken with Mr. Trump other times in recent weeks. He wrote the majority opinion last month establishing that federal civil rights law bars workplace discrimination against L.G.B.T. workers, and he wrote another majority opinion released on Thursday ruling that much of eastern Oklahoma falls within an Indian reservation.
Mr. Trump has attacked Chief Justice Roberts for his votes against the president’s positions in recent weeks, but not his own appointees up until now. Ms. McEnany said some of the rulings of recent weeks bolster the president’s determination to remake the judiciary. “We need more conservative justices on the court,” she said. “That’s been the big takeaway.”
Maggie Haberman contributed reporting from New York.