Friday's majority opinion, written by GOP appointee Thomas Griffith, goes to the heart of long-running battles over the power balance between Congress and the White House that have played out during Trump’s tenure.

Echoing arguments Justice Department attorneys had made in the case, Griffith warned that allowing the House to use the courts to enforce the subpoena against McGahn would lead to a flood of hard-to-resolve suits pitting congressional imperatives against executive branch interests.

“The walk from the Capitol to our courthouse is a short one, and if we resolve this case today, we can expect Congress’s lawyers to make the trip often,” wrote Griffith, an appointee of President George W. Bush.

Griffith said opening the courts to that kind of litigation would also discourage lawmakers and the executive branch from the more traditional method of resolving such subpoena fights: negotiation. Congress has long used several tools — cutting off funding, holding up presidential nominees, even impeachment — to help persuade the executive branch.

“Adjudicating these disputes would displace this flexible system of negotiation, accommodation, and (sometimes) political retaliation with a zero-sum game decided by judicial diktat,” Griffith wrote.

As it has for years, the Justice Department contended that top presidential advisers like McGahn and other Trump administration officials enjoy “absolute immunity” from speaking to congressional investigators. While the majority on the appeals court did not endorse the “absolute immunity” argument Friday, it did back an alternative DOJ contention that federal courts should not get involved in a dispute between the other two branches of government.

Indeed, while Judge Karen Henderson endorsed Griffith’s opinion, she explicitly rejected the administration’s claim of absolute immunity.

“McGahn’s assertion of absolute testimonial immunity against compelled congressional process is, in my opinion, a step too far, again, under Supreme Court precedent,” wrote Henderson, an appointee of President George H.W. Bush

At issue in the McGahn testimony case is the House Judiciary Committee’s long-running bid to question McGahn about what he told Mueller’s team during the more than 30 hours the ex-White House counsel met with investigators as part of their probe into Russian interference in the 2016 presidential election.

In a redacted version of Mueller’s final report , McGahn’s name appears more than 150 times, often during passages recounting the president’s attempts to kill or stymie the Russia investigation.

Democrats pivoting off the Mueller investigation issued a subpoena last April for documents and testimony from McGahn, but he skipped out on a scheduled hearing appearance with backing from a Justice Department legal opinion.

The House then sued McGahn. Last November, it secured a victory when U.S. District Court Judge Kentanji Brown Jackson ruled McGahn couldn’t hide behind the Trump administration’s claim of “absolute immunity.”

The dissenting vote on the three-judge panel backing Jackson’s original ruling came from Judge Judith Rogers, an appointee of President Bill Clinton. She emphasized that the demand for McGahn’s testimony came during an impeachment inquiry, adding that her colleagues’ refusal to enforce the House subpoena effectively gutted Congress’s impeachment powers.

“In the context of impeachment, when the accuracy and thoroughness of the investigation may well determine whether the President remains in office, the House’s need for information is at its zenith,” Rogers wrote.

In his majority opinion, Griffith conceded that in some situations, possibly including the current dispute over McGahn’s testimony, cutting off lawmakers’ ability to appeal to the courts will mean Congress does not get the testimony it is seeking.

“Sometimes, those tools will yield fewer concessions than Congress might wish, but the remedy for that perceived wrong is in politics or at the ballot box,” the judge wrote.

However, Rogers warned that turning lawmakers away from the courts could goad Congress into more extreme enforcement measures, potentially including use of the long-dormant “inherent contempt” powers to physically detain recalcitrant witnesses.

“It suffices here to note that the prospect that the House will direct its Sergeant at Arms to arrest McGahn is vanishingly slim, so long as a more peaceable judicial alternative remains available,” she wrote.

The ruling sets a March 9 deadline for Democrats to file any appeals either for another hearing before the same three-judge panel, or to seek review before the full, 11-member bench of the D.C. Circuit.

The court’s active judges include seven Democratic appointees and four GOP ones.

The House could also go directly to the Supreme Court, but with arguments for this term already set, final resolution of the dispute by the justices would almost certainly come after the November election.

House speaker Nancy Pelosi said Friday night that the House will ask the full bench of the appeals court to take up the issue.

For the Trump administration, Friday’s opinion represents one of its first major legal wins against House oversight efforts.

“We are extremely pleased with today’s historic ruling from the D.C. Circuit recognizing that the House of Representatives cannot invoke the power of the courts in its political disputes with the Executive Branch,” said DOJ spokeswoman Brianna Herlihy. “Suits like this one are without precedent in our nation’s history and are inconsistent with the Constitution’s design. The D.C. Circuit’s cogent opinion affirms this fundamental principle.”

House GOP lawmakers long critical of the Democrats' investigative efforts also celebrated the decision.

"Today's #McGahn ruling confirms what Republicans have said all along. Getting executive branch information takes time and accommodations. Democrats threw a temper tantrum by demanding information in the manner, form, and forum of their choosing," Georgia Rep. Doug Collins, the Judiciary Committee's top Republican, said on Twitter.

Bill Burke, an attorney for McGahn, declined comment on Friday’s ruling and said he’d maintain the same posture “while the litigation is pending.”

Friday’s decision could have implications beyond just the McGahn case itself. It may also be bad news for Democrats suing to obtain Trump’s federal tax returns. Another federal district court judge paused the suit to first see how the appeals court decided the McGahn case.

In the taxes case, House Ways and Means Committee Chairman Richard Neal is asking the courts to enforce a subpoena for the president’s tax filings. The suit raises basic questions about whether Congress is allowed to sue the executive branch, something the Supreme Court has never clearly addressed.

Trump’s lawyers have been seeking to dismiss Neal’s suit, arguing he doesn’t have the right to take them to court. They previously predicted that if Democrats lost the McGahn case, it would potentially sink Neal’s suit, as well.

While the D.C. Circuit's McGahn decision appeared to skirt some of the key issues in Neal's lawsuit it still could carry negative implications for all court fights involving congressional demands for executive branch information. Shortly after the appeals court issued its decision Friday, District Court Judge Trevor McFadden announced a Thursday hearing to consider Democrats’ demands to allow their tax-return case to proceed.

Brian Faler contributed to this report.