The U.S. Supreme Court ruled that the House of Representatives cannot require tax returns from President Donald Trump, Fox News reported.

In a 7-2 ruling, the highest court ruled Thursday that Democrats cannot just demand any documents they want under the separation of powers argument.

The result in Trump v. Mazars USA, LLP is the opposite of the same day’s result in Trump v. Vance, in which the court ruled that New York City prosecutors can get the tax returns.

While both cases appear similar, there are substantive differences.

In the New York case—Trump v. Vance—the subpoena for the president’s tax returns specifically referred to an ongoing investigation by an investigative jury to determine whether Donald Trump or the Trump Organization violated any laws regarding potential payments of money to “silence” two plaintiffs.

The Supreme Court ruling determined that President Trump was not covered by presidential immunity and therefore had to serve the subpoena documents, although the case was referred to a lower court, meaning that the records would not be served immediately.

In the case championed by the House Democrats—Trump v. Mazars—the issue was whether legislators had the right to know Trump’s taxes and financial records under the guise of initiating an investigation into whether the conflict of interest and disclosure laws needed to be changed or updated.

It was there that the Supreme Court ruled in favor of President Trump.

Chief Justice John Roberts summarized the case:

“We have held that the House has authority under the Constitution to issue subpoenas to assist it in carrying out its legislative responsibilities. The House asserts that the financial information sought here—encompassing a decade’s worth of transactions by the President and his family—will help guide legislative reform in areas ranging from money laundering and terrorism to foreign involvement in U. S. elections. The President contends that the House lacked a valid legislative aim and instead sought these records to harass him, expose personal matters, and conduct law enforcement activities beyond its authority.”

In that regard, Roberts noted that such disputes between the executive and legislative branches usually are resolved through political negotiation, but not through the courts.

He expressed concern about the separation of powers and the call of the Democratic opposition in the House of Representatives:

“Far from accounting for separation of powers concerns, the House’s approach aggravates them by leaving essentially no limits on the congressional power to subpoena the President’s personal records. Any personal paper possessed by a President could potentially ‘relate to’ a conceivable subject of legislation, for Congress has broad legislative powers that touch a vast number of subjects. … Without limits on its subpoena powers, Congress could ‘exert an imperious controul’ over the Executive Branch and aggrandize itself at the President’s expense, just as the Framers feared.”

In the decision in favor of President Trump, the two judges he nominated, Brett Kavanaugh and Neil Gorsuch, joined the majority. The dissenters were Justices Clarence Thomas and Samuel Alito.