WASHINGTON (AP) — President Donald Trump will sign Congress' border security compromise, Senate Majority Leader Mitch McConnell said Thursday. The announcement removed the last ounce of suspense over the fate of a bill that would provide just a sliver of the money Trump wants to build a wall with Mexico but also would avoid a new government shutdown.

But McConnell also said Trump would quickly declare a national emergency. The president has said that move would give him power to divert money from other budget projects into wall building.

McConnell also said he would support Trump's emergency declaration. That was a turnabout for the Kentucky Republican, who like Democrats and many Republicans has until now opposed such a declaration.

The emergency declaration will inject the likelihood of fresh conflict between Congress and Trump over his efforts to build barriers along the boundary with Mexico. Opponents have said there is no crisis at the border and Trump is merely sidestepping Congress.

The Republican-controlled Senate began voting on the agreement Wednesday, and passage by that chamber and the Democratic-led controlled seemed certain.

Trump had signaled he would sign the bill but it was unclear until McConnell's announcement if he would do so, prompting some lawmakers to voice concern.

"Let's all pray that the president will have wisdom to sign the bill so the government doesn't shut down," said Sen. Charles Grassley, R-Iowa, chiming in after a guest chaplain opened Thursday's session.

Trump's assent would end a raucous legislative saga that commenced before Christmas and was ending, almost fittingly, on Valentine's Day. The low point was the historically long 35-day partial federal shutdown, which Trump sparked and was in full force when Democrats took control of the House, compelling him to share power for the first time.

Trump yielded on the shutdown Jan. 25 after public opinion turned against him and congressional Republicans. He'd won not a nickel of the $5.7 billion he'd demanded for his wall but had caused missed paychecks for legions of federal workers and contractors and lost government services for countless others. It was a political fiasco for Trump and an early triumph for House Speaker Nancy Pelosi, D-Calif.

The fight left both parties dead set against another shutdown. That sentiment weakened Trump's hand and fueled the bipartisan deal, a pact that contrasts with the parties' still-raging differences over health care, taxes and investigations of the president.

The product of nearly three weeks of talks, the agreement provides almost $1.4 billion for new barriers along the boundary. That's less than the $1.6 billion for border security in a bipartisan Senate bill that Trump spurned months ago, and enough for building just 55 miles of barricades, not the 200-plus miles he'd sought.

Notably, the word "wall" — which fueled many a chant at Trump campaign events and then his rallies as president — does not appear once in the 1,768 pages of legislation and explanatory materials. "Barriers" and "fencing" are the nouns of choice.

The compromise would also squeeze funding for Immigration and Customs Enforcement, or ICE, in an attempt to pressure the agency to gradually detain fewer immigrants. To the dismay of Democrats, it would still leave an agency many of them consider abusive holding thousands more immigrants than it did last year.

The measure contains money for improved surveillance equipment, more customs agents and humanitarian aid for detained immigrants. The overall bill also provides $330 billion to finance dozens of federal programs for the rest of the year, one-fourth of federal agency budgets.

Trump has talked for weeks about augmenting the agreement by taking executive action to divert money from other programs for wall construction, without congressional sign-off. He might declare a national emergency, which has drawn opposition from both parties, or invoke other authorities to tap funds targeted for military construction, disaster relief and counterdrug efforts.

Those moves could prompt congressional resistance or lawsuits, but would help assuage supporters dismayed that the president is yielding.

Rep. Mark Meadows, R-N.C., who leads the hard-right House Freedom Caucus, told reporters "it would be political suicide" if Trump signs the agreement and did nothing else to find added money.

The measure was expected to be carried by pragmatists from both parties. Many of Congress' most liberal members were expected to oppose it, unwilling to yield an inch to Trump's anti-immigrant policies, while staunch conservatives preferred a bill that would go further.

"I made a promise to my community that I wouldn't fund ICE," said Rep. Alexandria Ocasio-Cortez, D-N.Y., a freshman who's become a face of her party's left wing and a leading proponent of eliminating the agency.

Though Trump lost the highest-profile issue at stake, he all but declared victory Wednesday.

At the White House, he contended that a wall "is being built as we speak." Work on a small stretch of barriers is due to start this month in Texas' Rio Grande Valley under legislation Congress approved last year.

Swallowing the deal would mark a major concession by Trump, who has spent months calling the situation at the southern border a national security crisis. In private conversations, Trump has called the congressional bargainers poor negotiators, said a person familiar with the conversations who wasn't authorized to speak publicly.

Trump has repeatedly vowed Mexico would pay for the wall, a suggestion that country has spurned. His descriptions of the wall's size have fluctuated, at times saying it would cover 1,000 of the 2,000-mile boundary. Previous administrations constructed over 650 miles of barriers.

Facing opposition from Trump, Democrats lost their bid to include language giving federal contractors back pay for wages lost during the last shutdown. Government workers have been paid for time they were furloughed or worked without paychecks.

Also omitted was an extension of the Violence Against Women Act. Democrats say this will give them a chance later this year to add protections for transgender people to that law.