President Trump reacted angrily to a pair of Supreme Court rulings about his financial records Thursday, taking to Twitter to call them “not fair to this Presidency or Administration!” and describing himself as the victim of a “political prosecution.”

Hours later, the White House released a statement saying Trump was “gratified” by one of the decisions and had been “protected” in the other.

The disjointed responses underscore what in some ways represented a split decision for the president, marked by political and legal ramifications that hold both risks and advantages ahead of the November election.

While it appears that Trump will be able to keep his financial records and tax returns out of the public eye between now and the election, the court rejected his lawyers’ claims of “absolute immunity” and sent one of the cases back to the lower court for further litigation. The decision will give Democrats, including presumptive presidential nominee Joe Biden, more ammunition in their attempts to raise ethical questions about a president who has fought relentlessly to keep his financial records out of the public eye, said Russell Riley, a presidential historian at the University of Virginia’s Miller Center.

“In the short term, this sets aside the immediate problem of having to confront whatever it is in those records that Trump doesn’t want people to see,” he said. “But it also generates an additional vulnerability for Biden to exploit among that small group of people who may still be undecided.”

Trump’s tax returns have been a subject of interest for several reasons. Upon entering the White House, Trump took the unusual step of retaining ownership of his global business, which makes money from foreign and domestic interests with business before his government. They have also been sought in a case regarding hush-money payments made to women who have alleged they had affairs with the president before he took office.

Every president since Jimmy Carter has made his tax returns public.

Trump, who promised to release his tax returns in 2015 but has not yet done so, has been dogged by the issue as Democrats in Congress and prosecutors in New York have waged a legal battle to procure the records. The president and his lawyers sought refuge in the Supreme Court, where Trump’s appointment of two justices bolstered his confidence that he would ultimately prevail.

But in a pair of 7-to-2 decisions, the final victory the president had been seeking remained elusive — allowing the tax return issue to linger just ahead of the election.

As Democrats pledged to press ahead with their effort to force Trump to release his records, the White House sought to cast their quest as the latest in a long string of attempts to harass the president.

“Last year, Democrat-run House committees subpoenaed President Trump’s financial records in an effort to gain partisan advantage in the upcoming presidential campaign,” press secretary Kayleigh McEnany said in the statement describing Trump as “gratified” by the Supreme Court decision remanding the House Democrats’ case back to the lower courts.

Biden appeared eager Thursday to use the rulings to draw a contrast between his own financial background and Trump’s wealth. After the Supreme Court rulings were released, Biden took to Twitter to retweet a post from last October in which he described himself as “one of the poorest men in government” during his ­decades-long Washington career. Biden has released 21 years of tax records, following the tradition of all major recent presidential candidates except for Trump.

“Mr. President, even Richard Nixon released his tax returns,” Biden said in the video, which was originally posted during the House impeachment investigation into whether Trump pressured a foreign government to announce a probe of Biden’s family. “Mr. President, release your tax returns or shut up.”

The former vice president also gave a speech Thursday in his hometown of Scranton, Pa., that he used to try to further highlight the difference between his ­working-class roots and the president’s millionaire lifestyle.

“You see, growing up rich and looking down on people is very different from how I grew up here,” he said.

Trump claims he will not release his tax returns because of a long-running audit by the Internal Revenue Service — a dubious position because there is no law preventing him from releasing returns that are under audit. He has argued that Democrats are seeking his records only for political reasons. He has described himself as the victim of a corrupt legal system that shields his opponents and continues to target him unfairly.

“It’s a political witch hunt, the likes of which nobody’s ever seen before,” Trump told reporters Thursday, accusing President Barack Obama and Biden of having illegally spied on his campaign — an allegation he has repeatedly made without evidence. “It’s the biggest political crime in the history of our country.”

Democrats pointed to the near-unity among the justices in arguing that Trump was being held to account after long resisting the demands of Congress and prosecutors.

House Speaker Nancy Pelosi (D-Calif.) and House Democratic investigative chairs hailed the pair of decisions as a victory and a clear indication that the president is not above the law. However, many rank-and-file Democrats were unhappy with the ruling in the case involving their subpoena for Trump’s records, arguing that it allows the president to run out the clock and could have long-term consequences for Congress’s oversight authority.

Some Democrats expressed disappointment that they almost certainly will not see Trump’s tax returns before the election. The high court’s move to send the case back to the lower court all but assures that Democrats won’t be able to get their hands on Trump’s tax returns and financial information before November, Democrats said. So even if they are successful in the end, it may come after their greatest chance of booting him from office.

“While defeated on his claim that he’s above the law, Trump is now beyond the law until after November,” said Rep. Lloyd Doggett (D-Tex.), a member of the House Ways and Means Committee, which requested Trump’s tax returns. “He may not be able to outrun the law, but he’s outrunning the clock.”

Rep. Jamie B. Raskin (D-Md.), a member of the Oversight and Judiciary panels, called the decisions a “tie” between the executive and legislative branch.

“The court seems to have bent over backward to accommodate the extreme position of the president by treating Congress essentially like an administrative law tribunal,” he said. “I would have preferred a far more sweeping defense of congressional power to obtain the information it needs to legislate and conduct oversight.”

Democrats’ concerns go beyond Trump’s ability to slow their investigations of him; they’re also worried about a new institutional precedent that waters down the strength of their subpoenas. The court suggested that Congress must clearly articulate a legislative purpose for its investigations — and that the subpoenas for Trump’s financial records and taxes were not clearly defined and failed to explain why the information was necessary.

Doggett, who had been pushing for the House Ways and Means Committee to move faster in requesting Trump’s tax returns, blamed his own colleagues for what he viewed as disappointing results. Democrats, he said, should have moved quicker to demand Trump’s tax returns rather than waiting to go to court until last summer.

Republicans used the ruling to continue their vocal defense of Trump, claiming that Democrats were more interested in investigating the president than solving the country’s problems.

Rep. Jim Jordan (Ohio), the top Republican on the House Judiciary Committee, lamented that the court decisions were not the final word on access to Trump’s records.

“For almost four years, Democrats have been singularly focused on attacking President Trump for political gain,” he said in a statement. “Today’s decisions by the Supreme Court sadly will not end the Democrats’ partisan obsession. Americans around the country deserve better than the Democrats’ never-ending political games.”

Although some Republicans — including Trump’s son Donald Trump Jr. — tried to revive allegations about Biden’s family finances in the wake of the rulings, Biden’s decision to release his tax returns makes the financial issue more potent as an attack against the president, Riley said.

“Biden and his team will be allowed to exploit the unknown to their advantage,” he said. “It’s a little bit like the theory behind some of the best horror movies, where the horror isn’t so much what actually happens, but it’s allowing the audience to play up in their imaginations what their greatest fears are in effect.”

The congressional subpoenas that Trump is seeking to block followed testimony from Michael Cohen, the president’s former ­fixer, who told lawmakers that Trump had exaggerated his wealth to seek loans.

Two committees subpoenaed Capital One and Deutsche Bank as part of their investigation into Russian money-laundering and potential foreign influence allegedly involving Trump.

Federal judges in New York and Washington — at the district court and appeals court levels — moved swiftly by court standards and repeatedly ruled against Trump and to uphold Congress’s broad investigative powers.

The records Trump is fighting to keep concealed have already been shrouded in public scandal.

Manhattan District Attorney Cyrus R. Vance Jr. is investigating whether the Trump Organization falsified business records to conceal hush payments to two women, including adult-film actress Stormy Daniels, who claimed they had sex with Trump before he took office. Trump has denied those claims.

Vance is seeking Trump’s tax returns, among other records. The court ruled that Vance’s investigation could proceed, but because the records are for a grand jury investigation, they would probably not be disclosed before the election.

How quickly Vance will be able to move ahead with his case is unclear because Trump’s lawyers can challenge the specifics of subpoenas even with the court’s ruling that Trump is not protected from being subpoenaed.

One almost-certainty in the case is that Trump will continue to express a sense of grievance.

“Courts in the past have given ‘broad deference.’ BUT NOT ME!” he tweeted after the Supreme Court rulings were handed down.

Rachael Bade contributed to this report.