WASHINGTON — Congress approved a two-week stopgap measure on Thursday that will avoid a government shutdown this weekend, pushing until just before Christmas a broader possible showdown over spending priorities, immigration and health care.

The measure, which the House and Senate passed in quick succession, would fund the government through Dec. 22. President Trump is expected to sign it.

“Along with enacting historic tax reform, we’ll be working together in the next two weeks to find a long-term solution to our funding needs while maintaining fiscal discipline,” said Speaker Paul D. Ryan of Wisconsin.

The approval came as congressional leaders from both parties met with Mr. Trump at the White House to talk about the thicket of issues facing lawmakers as the end of the year approaches.