US President Donald Trump is known for his unpredictability. Photo: AFP/Jim Watson

The US Supreme Court delivered a blow to President Donald Trump on Thursday, rejecting his claim of immunity from criminal investigation and ruling that his financial records must be handed over to New York prosecutors.

But the nation’s highest court, in a decision in a separate case, temporarily blocked Trump’s Democratic opponents in Congress from accessing his tax returns and business files.

The rulings prompted a string of furious tweets from Trump, but they may actually allow the New York real estate tycoon to keep his tax returns and other financial documents hidden until after the November election.

The court ruled 7-2 against Trump in a case brought by Manhattan district attorney Cyrus Vance, a Democrat who is seeking the president’s financial records in connection with a “hush money” payment made to adult film actress Stormy Daniels that may have violated campaign finance laws.

While the court ruled that Trump’s accountants must turn over the records, it did leave room for his lawyers to challenge the scope of the district attorney’s subpoena in a lower court.

Both of the conservative justices appointed by Trump – Neil Gorsuch and Brett Kavanaugh – joined Chief Justice John Roberts and the four liberal justices in rejecting the claim by Trump’s lawyers that a president enjoyed absolute immunity.

‘Tremendous victory’

The other case concerned a request by three Democratic-led House committees for Trump’s tax returns and other records. The Republican president received a temporary reprieve there.

In another 7-2 ruling, the court sent the congressional case back to a lower court, saying it needs to further examine the question of separation of powers between the legislative and executive branches of government.

Vance called the ruling “a tremendous victory for our nation’s system of justice and its founding principle that no one – not even a president – is above the law.”

“Our investigation, which was delayed for almost a year by this lawsuit, will resume, guided as always by the grand jury’s solemn obligation to follow the law and the facts, wherever they may lead,” Vance said.

Even if Trump’s financial records are eventually turned over to the New York prosecutors they may remain hidden from public view because of grand jury secrecy.

Jay Sekulow, Trump’s attorney, sought to portray the rulings as a win for Trump but the president reacted angrily.

“This is about PROSECUTORIAL MISCONDUCT,” Trump tweeted.

“This is all a political prosecution,” Trump added. “Now I have to keep fighting in a politically corrupt New York. Not fair to this Presidency or Administration!”

The president had a more measured response several hours later. “From a certain point I’m satisfied, from another point I’m not satisfied,” Trump told reporters.

Sekulow said he was “pleased” by the decisions.

“The Supreme Court has temporarily blocked both Congress and New York prosecutors from obtaining the President’s financial records,” Sekulow said. “We will now proceed to raise additional Constitutional and legal issues in the lower courts.”

‘Press our case’

Nancy Pelosi, Democratic speaker of the House of Representatives, said she would continue to press for Trump’s  records to be handed over to Congress.

“The Congress will continue to conduct oversight For The People, upholding the separation of powers that is the genius of our Constitution,” Pelosi said. “We will continue to press our case in the lower courts.”

The Democratic-led committees are looking into the president’s finances and those of the Trump Organization and his family in what started as a probe into foreign influence in the 2016 election.

Trump’s secrecy over his tax returns and personal finances has prompted speculation about his true worth and possible financial entanglements.

Trump promised to release his tax returns during his 2016 campaign for the White House but has declined to do so.

US presidents are not required by law to release details of their personal finances but every US leader since Richard Nixon has done so.

The politically sensitive cases were being closely watched because of their potentially far-reaching implications on the limits of presidential power and congressional authority.