WASHINGTON (Reuters) - A 35-day struggle between President Donald Trump and the U.S. Congress to cut a deal to end the partial government shutdown finally ended on Friday. Now the hard part begins.

U.S. President Donald Trump announces a deal to end the partial government shutdown as he speaks in the Rose Garden of the White House in Washington, U.S., January 25, 2019. REUTERS/Kevin Lamarque

Republican and Democratic lawmakers will have until Feb. 15 to craft a border security agreement satisfactory to both sides.

Trump has threatened that if he doesn’t like the outcome, he could throw the government right back into shutdown mode.

Or, he also said, he might try declaring a “national emergency” which, he said, would get him the $5.7 billion he wants for a U.S.-Mexico border wall. Such a step would also likely trigger a court battle with Democrats.

While Trump did not get that money in Friday’s deal, he won a promise that Congress will work on a Department of Homeland Security spending bill that contains border security funding for the rest of the fiscal year ending on Sept. 30.

Here is how the negotiations in Congress are expected to go:

CONFERENCE COMMITTEE

A “conference committee” will be appointed by Senate Republican Leader Mitch McConnell and Democratic House of Representatives Speaker Nancy Pelosi, who led the opposition to Trump’s demand that his border wall money be part of any legislation to fully reopen the government.

The committee will include members of the House and Senate appropriations panels. They will meet in public session and in private sessions to work on a “conference report.”

Trump will try to pressure fellow Republicans to insist on including $5.7 billion in the report for his wall, although a White House aide said on Friday a compromise for less would be acceptable. Democrats are likely to resist any wall funding.

The committee will weigh different compromises, including possibly $1.6 billion in border security spending resembling a request Trump included in his budget proposals to Congress last year. Higher sums are likely to be debated too.

A House Democratic aide said the committee also could consider major changes to U.S. immigration law, such as providing protection from deportation for “Dreamers,” those undocumented immigrants who were brought into the United States when they were minors.

The committee will specify uses for any border money. In the past, Congress has provided money for “physical barriers” along the border and for electronic sensors, drones and other tools.

Once a deal is struck, the conference committee members will vote to send it to the House and Senate floor for passage.

FLOOR ACTION

Under the rules, lawmakers can try to remove provisions in the agreement seen as outside the scope of the conference committee.

If the House and the Senate each pass the conference agreement, it will go to the president for signing into law.

If at any point in the process there is a breakdown, there is the risk of government agencies being thrown back into partial shutdown after Feb. 15.

Alternatively, Congress could pass another stopgap funding bill to give conferees a little more time to work out a deal.