8:55 p.m.

Hard-fought legislation that gives President Donald Trump 55 additional miles of fencing along the U.S.-Mexico border – well short of what he requested – is on the way to his desk after a bipartisan House vote.

The bill also closes a chapter by preventing a second government shutdown at midnight Friday and by providing $333 billion to finance several Cabinet agencies through September.

Trump has indicated he’ll sign the measure though he is not happy with it, and for a few hours Thursday he was reportedly having second thoughts.

The White House has announced Trump will declare a national emergency that would enable him to transfer funding from other accounts for additional miles of border fencing.

6 p.m.

Some Democratic state attorneys general say they may go to court to block any declaration of a national emergency on the southern border by President Donald Trump.

Attorney General Xavier Becerra of California wrote Thursday on Twitter that any border crisis is of the president’s own making and “we will do what we must to hold him accountable.”

His counterpart in Washington state, Bob Ferguson, said that if Trump’s declaration depletes federal aid to the state, he’ll “take appropriate steps to block this unlawful action.”

On Twitter, Puerto Rico Gov. Ricardo Rossello told the president “we’ll see you in court” if he goes through with the declaration.

Trump is prepared to invoke a national emergency to build the U.S.-Mexico wall after Congress refused to provide $5.7 billion he was demanding as part of a budget compromise to avoid a federal shutdown.

5:30 p.m.

The Democratic Party’s field of presidential hopefuls is split on a $333 billion government funding bill that includes nearly $1.4 billion in money for barriers along the U.S.-Mexico border.

The funding bill won support from Sen. Amy Klobuchar of Minnesota, who launched her presidential campaign Sunday, and from Vermont Independent Sen. Bernie Sanders, who is expected to join the Democratic primary soon. Ohio Sen. Sherrod Brown, another Democrat weighing a presidential run, also voted in favor.

White House hopefuls who opposed the legislation include California Sen. Kamala Harris, New Jersey Sen. Cory Booker, Massachusetts Sen. Elizabeth Warren and New York Sen. Kirsten Gillibrand.

Sanders says he has “concerns” about the bill but “I cannot turn my back on” federal workers who would have to work unpaid in a government shutdown.

This item has been corrected to show that the government funding bill is $333 billion, not $333.

5 p.m.

The top two Democrats in Congress say President Donald Trump’s upcoming move to declare a national emergency to fund his U.S.-Mexico border wall would be “a lawless act” and “a gross abuse of the power of the presidency.”

House Speaker Nancy Pelosi and Senate Minority Leader Chuck Schumer say in a joint statement that “Congress will defend our constitutional authorities.”

Pelosi has the ability to pass legislation to overturn any such move by Trump, and that measure could pass the GOP-held Senate as well, though Trump could veto it. Trump’s move would also face a certain court challenge.

Pelosi and Schumer say, “This is not an emergency, and the president’s fearmongering doesn’t make it one.”

4:45 p.m.

Congressional aides say there is $21 billion in military construction funds that could potentially be used by President Donald Trump to build a wall on the southern border, if he declares an emergency.

The aides say the president has the authority to take the funds, but according to the law they have to be used in support of U.S. armed forces.

There is about $10 billion in funds from the current 2019 fiscal year that ends Sept. 30, and another $11 billion from the previous four years that haven’t been obligated or contracted for a project, the aides say. They spoke on condition of anonymity because they weren’t authorized to speak publicly about the funding details.

The Defense Department has declined to provide any details on the amount of money available.

Lolita C. Baldor

4:22 p.m.

The Senate has passed a bipartisan border security plan that would finance 55 additional miles of fencing along the U.S.-Mexico border, significantly less than President Donald Trump wanted.

The vote came shortly after the White House announced he’ll sign the measure – and immediately announce he’ll use emergency powers to build additional miles without approval from Congress.

The 83-16 Senate vote advances the measure to the House for a vote Thursday night that would send it to Trump for his signature in time to avert another partial government shutdown this weekend.

Senate Majority Leader Mitch McConnell, who has previously said he opposes the use of emergency powers, said he will support Trump’s decision to use them.

The border security plan is part of a broader $333 billion spending bill.