The court’s ruling, expected by June, could release information the president has tried to protect. Or the justices could rule that his financial affairs are not legitimate subjects of inquiry so long as he remains in office.

Credit...Al Drago for The New York Times

WASHINGTON — The Supreme Court agreed on Friday to decide whether President Trump can block the release of his financial records, setting the stage for a blockbuster ruling on the power of presidents to resist demands for information from prosecutors and Congress.

The court’s ruling, expected by June, could require disclosure of information the president has gone to extraordinary lengths to protect. Or the justices could rule that Mr. Trump’s financial affairs are not legitimate subjects of inquiry so long as he remains in office.

Either way, the court is now poised to produce a once-in-a-generation statement on presidential accountability.

The case will test the independence of the court, which is dominated by Republican appointees, including two named by Mr. Trump. In earlier Supreme Court cases in which presidents sought to avoid providing evidence, the rulings did not break along partisan lines.

To the contrary, the court was unanimous in ruling against Presidents Richard M. Nixon and Bill Clinton in such cases, with Nixon and Clinton appointees voting against the presidents who had placed them on the court. The Nixon case led to his resignation in the face of mounting calls for his impeachment. The Clinton case led to Mr. Clinton’s impeachment, though he survived a Senate vote on his removal.

Mr. Trump asked the court to block three sets of subpoenas, and the justices agreed to decide his appeals in all three. The court said that arguments would be held over two hours in late March or early April, but it did not specify the date.

All of the subpoenas sought information from Mr. Trump’s accountants or bankers, not from Mr. Trump himself, and the firms have indicated that they will comply with the court’s ruling. Had the subpoenas sought evidence from Mr. Trump himself, there was at least a possibility that he would try to defy a ruling against him, prompting a constitutional crisis.

One of the cases concerned a subpoena to Mr. Trump’s accounting firm, Mazars USA, from the office of the Manhattan district attorney, Cyrus R. Vance Jr., a Democrat. It sought eight years of business and personal tax records in connection with an investigation of the role that Mr. Trump and the Trump Organization played in hush-money payments made in the run-up to the 2016 election.

Both Mr. Trump and his company reimbursed the president’s former lawyer and fixer, Michael D. Cohen, for payments made to the pornographic film actress Stormy Daniels, who claimed that she had an affair with Mr. Trump.

Mr. Cohen was also involved in payments to Karen McDougal, a Playboy model who had also claimed she had a relationship with Mr. Trump. The president has denied the relationships.

Mr. Trump sued to stop his accounting firm from turning over the records, but lower courts ruled against him. In a unanimous ruling, the United States Court of Appeals for the Second Circuit, in New York, said state prosecutors may require third parties to turn over a sitting president’s financial records for use in a grand jury investigation.

In a footnote to the decision, Chief Judge Robert A. Katzmann, wrote that the information sought was in a sense unexceptional.

“We note that the past six presidents, dating back to President Carter, all voluntarily released their tax returns to the public,” Judge Katzmann wrote. “While we do not place dispositive weight on this fact, it reinforces our conclusion that the disclosure of personal financial information, standing alone, is unlikely to impair the president in performing the duties of his office.”

In their petition urging the Supreme Court to hear their appeal, Trump v. Vance, No. 19-635, Mr. Trump’s lawyers argued that he was immune from all criminal proceedings and investigations so long as he remained in office. But even if some federal investigations may be proper, the petition said, the Supreme Court should rule that state and local prosecutors may not seek information about a sitting president’s conduct.

“That the Constitution would empower thousands of state and local prosecutors to embroil the president in criminal proceedings is unimaginable,” Mr. Trump’s lawyers wrote.

Mr. Vance responded that the Supreme Court’s decision in United States v. Nixon in 1974 essentially decided the central issue in Mr. Trump’s appeal. “This court has long recognized,” Mr. Vance wrote, “that a sitting president may be subject to a subpoena in a criminal proceeding.”

That the subpoena in the Nixon case came from a federal court rather than a state grand jury made no difference, Mr. Vance wrote. “The states’ strong interests in operating a fair and just criminal judicial process should be respected no less than the federal government’s parallel interests recognized in Nixon,” he wrote.

The Justice Department filed a friend-of-the-court brief urging the court to hear Mr. Trump’s appeal seeking to keep his financial records private. The brief did not adopt the broad position taken by Mr. Trump’s personal lawyers — that he is immune from criminal investigation while he remains in office. Rather, the department’s brief said that courts should require prosecutors to meet a demanding standard before they are allowed to obtain the information.

The second subpoena, also directed to the accounting firm, came from the House Oversight and Reform Committee, which is investigating the hush-money payments and whether Mr. Trump inflated and deflated descriptions of his assets on financial statements to obtain loans and reduce his taxes.

When Mr. Trump’s lawyers went to court to try to block the subpoena, they argued that the committee was powerless to obtain his records because it had no legislative need for them. They said the panel was engaged in an improper criminal inquiry and was not seeking information to help it enact legislation.

In October, a divided three-judge panel of the United States Court of Appeals for the District of Columbia Circuit refused to block the subpoena.

“Having considered the weighty interests at stake in this case, we conclude that the subpoena issued by the committee to Mazars is valid and enforceable,” Judge David S. Tatel, who was appointed by President Clinton, wrote for the majority. Judge Patricia A. Millett, appointed by President Barack Obama, joined the majority opinion.

In dissent, Judge Neomi J. Rao, appointed by Mr. Trump, wrote that “allegations of illegal conduct against the president cannot be investigated by Congress except through impeachment.”

In a brief urging the Supreme Court to deny review in the case, Trump v. Mazars USA, No. 19-715, lawyers for the committee argued that they had a legitimate need for the information they sought.

“The election of a president who has decided to maintain his ties to a broad array of business ventures raises questions about the adequacy of existing legislation concerning financial disclosures, government contracts with federal officeholders and government ethics,” the brief said. “Whether new legislation on these subjects is needed is a natural subject of congressional inquiry.”

The third set of subpoenas came from the House Financial Services and Intelligence Committees and were addressed to two financial institutions that did business with Mr. Trump, Deutsche Bank and Capital One. They sought an array of financial records related to the president, his companies and his family.

A different three-judge panel of the Second Circuit ordered most of the requested materials to be disclosed. It made an exception for sensitive personal information unrelated to the committee’s investigations.

“The committees’ interests in pursuing their constitutional legislative function is a far more significant public interest than whatever public interest inheres in avoiding the risk of a chief executive’s distraction arising from disclosure of documents reflecting his private financial transactions,” Judge Jon O. Newman wrote for the majority.

In urging the Supreme Court to block the Second Circuit’s ruling while the justices decided how to proceed in the case, Trump v. Deutsche Bank AG, No. 19A640, Mr. Trump wrote that “these ‘dragnet’ subpoena look nothing like a legislative inquiry.”

The committees responded that they need the information to address interference in American elections.

“Legislative efforts to secure the financial system from abuse have obvious importance,” lawyers for the committee told the justices. “And nothing is more urgent than efforts to guard against foreign influence in our systems for electing officials, particularly given the upcoming 2020 elections.”