WASHINGTON — The House on Tuesday approved a two-month extension of funding for transportation projects, setting up what could be a defining fight over money for highways and other infrastructure this summer after years of stopgap measures.

The extension, which passed in a 387-to-35 vote with one member voting present, would maintain funding for the Highway Trust Fund through July 31. The bill now goes to the Senate, which has just two legislative days left before a scheduled weeklong Memorial Day recess. The transportation program’s spending authority is set to expire during that break, on May 31.

Representative Steny H. Hoyer of Maryland, the No. 2 Democrat in the House, supported the Republican-sponsored legislation for short-term financing, but cautioned that Democrats would spend those 60 days finding permanent funding of the program, which for years relied on fuel taxes that are no longer keeping pace with the nation’s transportation needs.

“We believe very strongly that it is time to come to grips with a responsible, paid-for, effective, long-term extension of the highway bill,” Mr. Hoyer said.