The U.S. Court of Appeals for the Fourth Circuit ruled en banc to allow a lawsuit that alleges President Donald Trump is violating the Constitution's Emoluments Clause to advance.

In the rare full-court ruling Thursday, the judges found Trump did not have the ability to ask the federal appeals court to dismiss the lawsuit, as he claimed immunity from the legal challenge while in office.

"The president maintains that the district court committed multiple errors that we should correct; however, this case is not on appeal," Judge Diana Motz wrote in the court's majority opinion. "We recognize that the president is no ordinary petitioner, and we accord him great deference as the head of the executive branch. But Congress and the Supreme Court have severely limited our ability to grant the extraordinary relief the president seeks."

A three-judge panel on the circuit ruled last year to throw out the suit, finding the Maryland and D.C. attorneys general didn't have standing to bring forward the claims over Trump's Washington, D.C., hotel. The complaints allege that Trump is violating the anti-corruption clause by profiting off his private businesses while in office.

But the Fourth Circuit later agreed to grant a rare en banc rehearing of the case, giving the emoluments claims a second chance in court.

In Thursday's majority opinion, Motz wrote that Trump had not fulfilled the legal requirements needed for the form of legal relief he wanted, a writ of mandamus to either certify an interlocutory appeal challenging an order against the president's motion to dismiss or to dismiss the complaint.

Trump's attorneys had argued the district court's ruling was a "clear abuse of discretion" and therefore qualified him for the appeal. However, the majority opinion says that argument "has been repeatedly rejected by the Supreme Court."

The majority opinion also rejected Trump's request to throw out the complaint. Motz wrote the court recognizes the attorneys general "press novel legal claims. But reasonable jurists can disagree in good faith on the merits of these claims."

"The president's insistence that 'emoluments' indisputably include only 'profit arising from office or employ' (that is, payment for services rendered in performance of a formal job), while possible, is certainly not indisputable," the judge wrote. But Motz noted that attorneys for D.C. and Maryland had pointed to other legal opinions that back up their definition of the term—any profits Trump receives from foreign or domestic entities through his businesses—as well as a number of amicus briefs filed in the case in their favor.

"Given this history, we can hardly conclude that the president's preferred definition of this obscure word is clearly and indisputably the correct one," the opinion reads.

The court further rejected Trump's claims that allowing the case to survive would expose him to "intrusive discovery," calling the argument "puzzling" because the president "has not petitioned for relief as to any discovery order."

And the judges rejected Trump's argument that a court can't review his emoluments-tied actions, saying they "collapse under scrutiny."

"The duty to obey these particular laws—the Constitution's Emoluments Clauses—flows from the president's status as head of the executive branch, but this duty to obey neither constitutes an official executive prerogative nor impedes any official executive function," the opinion reads.

"The Framers, concerned about the corrosive effect of power and animated by fears of unduly blending government powers, dispersed the authority to enforce the law and the authority to interpret it. To hold otherwise would mean that the president alone has the ultimate authority to interpret what the Constitution means," Motz wrote. "Allowing the president to be the final arbiter of both the interpretation and enforcement of the law—as the dissents would—would gravely offend separation of powers. Rather than sanction an 'assault by the judicial branch against the powers of the executive,' our holding affirms the separation of powers principles dictated by the Constitution and endorsed by centuries of foundational jurisprudence."

Chief Judge Roger Gregory and Judges Robert King, Barbara Keenan, James Wynn Jr., Albert Diaz, Henry Floyd, Stephanie Thacker, and Pamela Harris all joined the majority opinion. Wynn wrote a concurring opinion.

Judges Paul Niemeyer and Harvie Wilkinson both wrote dissenting opinions. Judges Steven Agee, A. Marvin Quattlebaum and Allison Rushing joined each of the dissents.

Wilkinson wrote in his dissent that, in issuing the majority opinion, "the federal judiciary has sorely overstepped its proper bounds."

"I fear only for the future of the courts, where the absence of restraint is so evidently incompatible with the dictates of the law. This is not an occasion for business as usual. We are reaching the point of solving political differences increasingly through litigation rather than through legislation and elections," the judge wrote. "This is a profoundly anti-democratic development pressed in a suit whose wrongfulness and transparently political character will diminish the respect to which courts are entitled when they carry out the essential functions that our cherished Constitution has assigned them."

During oral arguments in December, Justice Department lawyer Hashan Mooppan and Trump private attorney Patrick Strawbridge of Consovoy & McCarthy both argued that the panel's prior ruling was correct. They said that allowing discovery to take place in the case would be intrusive to Trump, and prevent him from being able to carry out the official duties of the presidency.

The U.S. Court of Appeals for the D.C. Circuit earlier this year struck down an emoluments lawsuit from congressional Democrats challenging Trump over his D.C. hotel, finding the individual lawmakers lacked standing.

And the U.S. Court of Appeals for the Second Circuit last year revived another emoluments lawsuit brought by Citizens for Responsibility and Ethics in Washington and individual plaintiffs against Trump.

Read the Fourth Circuit's decision:

Read more: