WASHINGTON — The House on Tuesday voted to extend government funding for another month, rushing to ward off a government shutdown and setting up a pre-Christmas clash over spending just as the House is likely to be considering whether to impeach President Trump.

With just days before funding for the entire government is set to lapse on Thursday, lawmakers effectively postponed the spending fight for another day, approving another stopgap spending bill exactly two months after the first spending bill passed the chamber. The measure would extend funding through Dec. 20 for all federal government departments and agencies, as well as a number of health care and community programs.

That sets up a potentially explosive set of votes just before Christmas, when the House may be considering impeachment articles against Mr. Trump just as it is staring down a deadline to avoid a disastrous government shutdown.

The specter of last year’s 35-day shutdown drove a slim bipartisan margin on Tuesday, as most lawmakers agreed that a temporary spending bill maintaining current levels of funding for another four weeks was preferable to an encore of the breach last year, which lasted into January.