Following three weeks of spending negotiations, Congress passed a budget deal on Thursday to fund the federal government through the end of September. Even though it did not include the money President Trump demanded to build a border wall, he signed the deal and then immediately declared a national emergency in order to reprogram funding from other government agencies towards his wall.

The budget deal reached by Congress was the culmination of negotiations that began after Congress and the White House struck a deal to end the longest government shutdown in the nation’s history. Despite Trump’s original demand for $5.7 billion to build a border wall, the deal only included $1.35 billion for building steel bollard fencing along 55 miles of the border in the Rio Grande Valley.

The spending bill also provides additional funding for upgrading ports of entry to better detect drug smuggling, as well as money to improve conditions of custody for families seeking asylum. The bill also allocates $192 million to build a new facility in El Paso to temporarily hold families who are arriving at the border seeking asylum.

Although the bill passed Congress with wide margins from both parties, there was some opposition. Many immigration advocates were unhappy with the bill’s language requiring Immigration and Customs Enforcement (ICE) to have at most 40,520 individuals in detention by the end of the fiscal year. Because ICE is currently detaining almost 50,000 people, this provision would permit ICE to detain on average 45,000 people from now until the end of September, the highest level ever permitted by Congress.

At the same time, immigration restrictionists were upset by provisions that would expand the use of alternatives to detention and limit ICE’s ability to use information provided by the Office of Refugee Resettlement (ORR) about undocumented immigrants who “sponsor” a child so they can be released from ORR custody. A previous deal where ORR shared information on sponsors with ICE was widely criticized for leaving many children in government custody far longer than necessary. The new bill would end that practice.

Although President Trump initially expressed his unhappiness with the bill, on Thursday night the White House announced that he would sign the bill and declare a national emergency.

By declaring a national emergency, the president seeks to use $3.6 billion currently set aside for military construction to build a wall. He also wants to use $600 million currently held by the Department of Justice that was seized through civil forfeiture, as well as $2.5 billion from the Department of Defense’s drug interdiction budget.

On Friday, Trump gave a press conference officially announcing the national emergency declaration. He repeated multiple falsehoods during the conference, including rejecting his own administration’s conclusions that the majority of drugs come through ports of entry. The president claimed the government’s statistic was a “lie.”

Immediately following Trump’s national emergency declaration, multiple groups announced that they would file lawsuits challenging the declaration, including the ACLU and the State of California. Trump admitted that he expects to lose early rounds of litigation over the declaration but declared that “hopefully we’ll get a fair shake” once the case reaches the Supreme Court.