By Richard Cowan and David Morgan
WASHINGTON (Reuters) -The U.S. Congress on Tuesday labored against a tight deadline to write a massive bill funding military, homeland security and a range of other government programs following a deal reached by congressional leaders and the White House.
Failure to act by midnight Friday would mean that many federal offices will be ordered to begin shutting down some operations.
The package was expected to cover about three-quarters of the $1.66 trillion in discretionary government spending for the fiscal year ending Sept. 30.
The last sticking point in closed-door negotiations was funding for the Department of Homeland Security, as a surge in migrants at the U.S.-Mexico border has become a major issue in the election rematch between Democratic President Joe Biden and his Republican predecessor Donald Trump.
It also comes as the seasonal flow of migrants to the southern U.S. border normally ratchets up significantly with the onset of warmer spring weather.
Even with this deal in hand, it was unclear whether Congress, which often labors under protracted procedural hurdles, can wrap up its work by Friday's deadline.
It was unclear whether a fifth stop-gap funding bill since September might be sought to keep federal agencies operating seamlessly until the large bill can be enacted into law.
Republican House Speaker Mike Johnson and Democratic Senate Majority Leader Chuck Schumer revealed the agreement in a pair of statements on Tuesday morning.
President Biden promptly welcomed the deal, posting on X: "The House and Senate are now working to finalize a package that can quickly be brought to the floor, and I will sign it immediately."
The legislative text of the agreement, which must be finalized before lawmakers can vote on it, was still being written and congressional aides were not providing details until the language was nailed down.
Besides Homeland Security and the Pentagon, the bill would fund the State Department and other agencies, including the Treasury Department's Internal Revenue Service as it girds for its April 15 taxpayer filing deadline.
Earlier this month, Congress funded several other agencies, including the Agriculture, Transportation, Justice and Interior Departments.
But more fights lie ahead as the nation's $34.5 trillion national debt continues to grow. Biden and House Republicans earlier this month laid out proposed budgets for the next fiscal year, which begins in October, that offered sharply contrasting priorities.
Johnson so far has also refused to bring up for a vote a $95 billion foreign security aid package that includes money that advocates say is urgently needed for Ukraine in its war against Russia.
The measure has been approved by the Senate with bipartisan support and is thought to have significant backing in the House if members were given a chance to vote.
Democrats and Republicans in Congress have been fighting since early last year on funding levels amid a push by hard line House Republicans to cut more spending than had been agreed to in a bipartisan deal enacted into law last June.