Senate Majority Leader Mitch McConnell (R-KY) talks to reporters following the weekly policy luncheon at the U.S. Capitol February 6, 2018 in Washington, DC.

Congressional leaders are moving closer to a long-term spending deal with the clock ticking down to what would become the second partial U.S. government shutdown in less than a month.

Senate leaders could announce an agreement to boost spending for defense and domestic programs as soon as Wednesday. A day earlier, President Donald Trump said he would "love" to see a shutdown if Democrats do not get behind his immigration demands. The government's funding authority lapses at the end of Thursday.

Senate Majority Leader Mitch McConnell, R-Ky., and Senate Minority Leader Chuck Schumer, D-N.Y., showed optimism Tuesday about the progress toward a deal. They may have to extend funding for only another few weeks while they hash out the longer-term agreement.

Still, multiple factors could cause any deal reached by the chamber to fall apart before the deadline.

On Tuesday night, the GOP-controlled House passed another stopgap bill to extend government funding through March 23. The Senate likely will not approve that legislation and send a different version back to the House. The Senate's bill could reportedly fund the government for the short term, extend the federal debt ceiling and authorize relief funds for last year's string of natural disasters.

McConnell said Tuesday afternoon he was "optimistic that very soon we'll be able to reach an agreement" on a more stable spending plan to pass after a shutdown is averted. While specific terms of the deal appear not to be finalized, reports indicate it could fund the government for two years.

It would increase defense spending to appease Republicans, and boost domestic spending by nearly as much to meet Democrats' demands, according to The Washington Post.