Lawmakers approved a broad measure Friday that freezes federally subsidized student loan rates for another year, reauthorizes the government flood insurance program and extends federal transportation funding for two more years.

The deal resolved months of acrimonious debate on key legislative concerns on the eve of a Fourth of July recess, and offered President Obama an opportunity to claim victory after a high-profile campaign to pressure Congress into action on both the student loan and transportation issues.

But it also provided an opening to Republicans to challenge the president’s long-running argument that he is hamstrung by a do-nothing Congress: GOP aides jokingly claimed Friday that they had eliminated half of the president’s campaign stump speech in a single day of action.

White House press secretary Jay Carney said “there is still much more Congress can do to create jobs and grow the economy,” and urged lawmakers to pass Obama’s jobs plan.

The agreement includes the first long-term transportation spending plan agreed to since 2005, replacing a series of short-term extensions. It passed the House 373 to 52 and the Senate by a vote of 74 to 19.

“This legislation proves that when Republicans decide to work with Democrats, we can do a lot to move our economy forward,” Senate Majority Leader Harry M. Reid (D-Nev.) said.

House Speaker John A. Boehner (R-Ohio) called the bill “far from perfect,” but thanked both parties for working to resolve disagreements on how to pay for the measure. He said Republicans plan to keep fighting to authorize construction of the Keystone XL pipeline, which was not included in the final deal.

With the measure’s passage, loan rates will remain at 3.4 percent for another year, rather than rising to 6.8 percent. The change is estimated to help more than 7 million students, saving them an average of $1,000 on their loan. Also, eligibility for a federally subsidized loan will now be capped to 150 percent of the length of a college program, meaning students enrolled in a four-year program will only be able to receive loans for up to six years.

The deal also includes a five-year extension of the National Flood Insurance Program that covers roughly 5.6 million people. The plan ends federal coverage for vacation homes and gives the government greater flexibility to set rates. The bill includes provisions requiring that 80 percent of fines paid under the Clean Water Act by the BP oil company for the the 2010 Deepwater Horizon disaster be set aside for Gulf Coast states to restore affected areas.

The agreement passed Friday sets transportation funding at roughly $105 billion through fiscal 2014, averting a crisis for the nation’s road construction projects that could have occurred if Congress had failed to pass a deal by the expiration of a short-term deal Saturday night.

Republicans agreed to drop language authorizing the Keystone pipeline and Democrats agreed to omit $1.4 billion for conservation projects.

Supporters characterized the transportation deal as one of the most significant pieces of jobs legislation this year, arguing the funding would help save more than 2 million jobs.

House Transportation and Infrastructure Committee Chairman John Mica (R-Fla.) initially fought for a more ambitious spending plan, but conceded Friday, “With the financial condition of the United States, it’s the best we could do right now.”