By Kristina Peterson

WASHINGTON--The federal government's funding lapsed early Thursday morning when President Trump missed a midnight deadline to sign a new spending bill while traveling back from a campaign rally.

Mr. Trump was expected to sign a short-term spending measure, passed Wednesday evening by the Senate, when he returned from Minnesota, ending the brief funding lapse. The stopgap spending bill would fund the government through Dec. 11. Its current funding expired at 12:01 a.m. Thursday.

Because the bill had already been approved by both chambers of Congress and was expected to be signed into law by Mr. Trump, no government offices or services were expected to be significantly shut down.

The stopgap spending measure, approved by the Senate in an 84-10 vote Wednesday evening, pushes the next funding deadline until after the election, whose outcome will shape the political dynamics of Congress and the White House at the year's end. Lawmakers have said they hope to pass full-year spending bills in December, but said it would depend on the political climate.

"I think we'll have a good opportunity to do it but a lot depends on the attitude of Democrats and Republicans," Senate Appropriations Committee Chairman Richard Shelby (R., Ala.) said last week. "That's a worthy goal."

Sen. Patrick Leahy of Vermont, the top Democrat on the Senate Appropriations Committee, said Wednesday that he was committed to producing bipartisan Senate appropriations bills before mid-December.

Although its timing was tight, the spending bill became the least controversial issue before Congress this month after House Speaker Nancy Pelosi (D., Calif.) and Treasury Secretary Steven Mnuchin agreed to exclude any contentious policy measures.

"The last thing our country needs is a government shutdown in the middle of a global pandemic and an unprecedented economic crisis," Mr. Leahy said on the Senate floor.

All 10 no votes came from Senate Republicans, who balked at passing the continuing resolution, or CR.

"Unfortunately, this CR is much more than a short-term spending bill to bridge the gap which I am not willing to accept, so I voted no," Sen. Ron Johnson (R., Wis.) said on Twitter.

The bill hit a late snag when Democrats balked at a request from the White House for $21 billion in farm aid after President Trump announced new relief for farmers at a campaign rally. Mrs. Pelosi and Mr. Mnuchin hashed out an agreement last week that paired the funds for the Commodity Credit Corp., a Depression-era program designed to stabilize farm incomes, with new restrictions prohibiting any payments from going to fossil-fuel refiners or importers. The deal also provides roughly $8 billion in additional funding for nutrition programs, a Democratic priority.

"This victory for our Democratic priorities is a prelude to the work we will do in negotiating full year appropriations bills that invest for the children and for the people," House Appropriations Committee Chairwoman Nita Lowey (D., N.Y.) said in a statement after the House passed the spending bill last week.

Andrew Restuccia contributed to this article.

Write to Kristina Peterson at kristina.peterson@wsj.com