“The United States has a substantial interest in protecting the office of the president and the powers and duties vested in that office,” the brief said. “The United States also has a substantial interest in protecting the autonomy of the federal government from potential interference by the states.”

The subpoena from the Manhattan district attorney, Cyrus R. Vance Jr., a Democrat, threatened both interests, the brief said. “This case involves the first attempt in our nation’s history by a local prosecutor to subpoena personal records of the sitting president of the United States,” the brief said.

The subpoena sought information concerning the reimbursements made to the president’s former lawyer, Michael D. Cohen, for payments to Stormy Daniels, a pornographic film actress who said she had an affair with Mr. Trump. The president has denied the relationship.

A unanimous three-judge panel of the United States Court of Appeals for the Second Circuit, in Manhattan, ruled this month against Mr. Trump. The court, in a focused ruling, said state prosecutors may require third parties to turn over a sitting president’s financial records for use in a grand jury investigation.

The Justice Department’s brief said that ruling was novel. “The United States is unaware of any precedent for the issuance of a state criminal subpoena for a sitting president’s personal records, and the district attorney and the courts below have never identified one,” the brief said.