It's been a hectic year for President Donald Trump in the courts, as he has repeatedly found himself and his administration facing federal judges across the country.

While some of the opinions have been in his favor, like the U.S. Supreme Court allowing his long-promised wall on the southern border to be built, other rulings have ended in key defeats.

Here's a look at five of the most significant Trump-related court cases of 2019, some of which will continue well into 2020.

|

House Judiciary's impeachment lawsuits

A pair of district court judges in Washington, D.C., handed down rulings within weeks of each other that sided with the U.S. House's ability to conduct oversight and obtain materials that congressional lawyers argued are key to the impeachment inquiry.

Chief U.S. District Judge Beryl Howell of the District of Columbia in October ruled the Justice Department must give Robert Mueller grand jury information redacted from the special counsel's report to House Democrats deciding whether to impeach the president.

And soon after, U.S. District Judge Ketanji Brown Jackson of the District of Columbia similarly ruled the House could compel former White House counsel Don McGahn to testify as part of the impeachment inquiry.

"DOJ's present assertion that the absolute testimonial immunity that senior-level presidential aides possess is, ultimately, owned by the president, and can be invoked by the president to overcome the aides' own will to testify, is a proposition that cannot be squared with core constitutional values, and for this reason alone, it cannot be sustained," Jackson wrote.

House Democrats seized upon those rulings to show that their inquiries were being properly conducted. Both cases are now before the U.S. Court of Appeals for the D.C. Circuit, who will hear them in back-to-back arguments Jan. 3.

|

Trump's tax records

Trump sued in his private capacity several times to try and block House Democrats and other investigators from getting his tax records. He kicked off those lawsuits with one over a subpoena to his private accounting firm Mazars and followed it shortly with another on a subpoena for records at Deutsche Bank and Capital One.

District judges in D.C. and the Southern District of New York quickly ruled in favor of the House subpoenas. And the D.C. Circuit and U.S. Court of Appeals for the Second Circuit more recently also ruled that lawmakers could request the documents.

"To accept the Trump Plaintiffs' suggestion that Congress may impose no disclosure requirements whatsoever on the president—or, put another way, that the challenged subpoena could result in no valid legislation—would be to return to an 'archaic view of the separation of powers' that 'requir[es] three airtight departments of government,'" Judge David Tatel of the U.S. Court of Appeals for the D.C. Circuit wrote about the Mazars subpoena. "That is not the law."

An effort from the Manhattan district attorney's office to get documents from Mazars has moved through the courts more quickly, as Trump pushed for a preliminary injunction. U.S. District Judge Victor Marrero of the Southern District of New York had dismissed the lawsuit, but the Second Circuit vacated that ruling.

The U.S. Supreme Court has agreed to take up all of the cases, scheduling them to be heard in March. The justices consolidated the cases on the House subpoenas and will hear Vance's case separately.

|

Border wall

Trump ended a record 35-day government shutdown at the start of the year by declaring a national emergency to tap military funds for his border wall that Congress refused to fund. Lawsuits hit the docket almost immediately.

The House sued, and the case got thrown out (the D.C. Circuit will hear arguments on that in February.) But lots of environmental and local groups also sued. U.S. District Judge Haywood Gilliam of the Northern District of California agreed some of them would be irreparably harmed by the wall, and issued an injunction.

The U.S. Court of Appeals for the Ninth Circuit upheld the injunction, but the Supreme Court agreed to lift it while the rest of the case played out in lower court, a major victory for the president.

But it hasn't stopped the wall from being litigated: U.S. District Judge David Briones of the Western District of Texas issued another national injunction in December to stop the Trump administration from using $3.6 million in Pentagon funds for border wall construction.

"The Supreme Court has already stayed one erroneous injunction blocking the use of a different statutory authority to build the border wall and the administration plans to immediately appeal this incorrect decision, too," White House press secretary Stephanie Grisham said after the ruling.

|

Affordable Care Act

The Trump Justice Department's decision to stop defending the Affordable Care Act in court set off a flurry of activity at the Fifth Circuit. The U.S. House stepped in and joined a Democratic state coalition to defend the law against the challenge from a group of red states led by Texas.

The three-judge panel recently handed down its decision, finding that Obamacare's individual mandate is unconstitutional and ordered a district court to determine whether that provision can be separated from the rest of the law. The Democratic attorneys general, led by California's Xavier Becerra, are now vowing to take the case to the Supreme Court.

And even though Trump wasn't directly involved, he still celebrated the ruling, which came down shortly before he was impeached.

"Today's decision in Texas v. Azar is a win for all Americans and confirms what I have said all along: that the individual mandate, by far the worst element of Obamacare, is unconstitutional," Trump said in a statement.

|

Census

The Trump administration went all in when it came to adding a citizenship question to the 2020 census. But that effort went downhill in June, when Chief Justice John Roberts wrote in a 5-4 opinion that the Supreme Court believed the reasoning behind the question's addition was "contrived."

Trump didn't give up right away, saying officials would look for other ways to include the question. But judges blocked DOJ from swapping out the federal lawyers who had been working on the matter for years.

But the litigation over the question continues, as plaintiffs in the Southern District of New York are seeking sanctions against Trump administration officials. And the House recently sued in U.S. District Court for the District of Columbia, with the help of attorneys at Debevoise & Plimpton, to get documents about the question.

The Justice Department has already agreed to pay more than $9 million in legal fees over the initial litigation.