WASHINGTON (Reuters) – The Senate on Wednesday approved a bipartisan deal to reverse a recent spike in interest rates on millions of new federal student loans.

The legislation now moves to the House of Representatives, which is hoping to approve the deal before lawmakers leave Washington for a recess in early August.

The Senate voted 81-18 in favor of the deal.

The bill has the support of President Barack Obama, who was involved in negotiating a compromise, and Education Secretary Arne Duncan who said on Tuesday that the deal would be a win for students.

However, in a speech at the University of Central Missouri on Wednesday, Obama said that it was not enough to just lower the cost of student loans, and he promised to lay out a list of “aggressive” ideas by the fall to rein in college costs. “If college costs keep on going up, then there’s never going to be enough money,” Obama said.

Interest rates on new federal Stafford student loans automatically doubled to 6.8 percent on July 1 after lawmakers, trapped in partisan wrangling, failed to reach an alternative deal on time.

Congress has since sought a retroactive fix that would keep new borrowers from paying the higher rate.

After extensive negotiations last week, senators including Democrat Joe Manchin of West Virginia, Republican Richard Burr of North Carolina and Independent Angus King of Maine agreed to a plan to switch loans for the coming school year to a market-based rate.

The rate would roughly work out to 3.86 percent this year for undergraduates.

“This is a prudent and responsible proposal. It’s a best of all worlds for students because they get low rates now and a cap if the rates go higher,” King said before the vote.

The Bipartisan Student Loan Certainty Act would also retroactively lower interest rates for all borrowers who have taken out federal student loans from July 1, 2013.

It would cap rates at 8.25 percent for undergraduates, 9.5 percent for graduate students, and 10.5 percent for PLUS loans for parents who borrow to pay for their children’s college.

The Democrat-led Senate earlier blocked a number of bills addressing student loan interest rates due to partisan disagreements.

Democrats in both the Senate and the House have consistently opposed market-based approaches because they feared students would not be adequately protected from future interest rate spikes as the economy recovers.

They have also criticized Republican plans that would use proceeds from federal student loans to help pay down the nation’s debt.

The new student loan deal would reduce the nation’s deficit by $715 million over a decade, according to the non-partisan Congressional Budget Office.

That is just a fraction of other bills, such as the market-based plan passed by the House that would have reduced the deficit by $4 billion over a decade.

“We wanted this to come as close to deficit neutral as possible and that’s what we’ve come to,” said Democratic Senator Tom Harkin of Iowa, one of the lead negotiators. “That’s the closest we can come to zero and at the same time have hard caps and keep interest rates low.”

In a letter right after the vote, California Representative George Miller, the senior Democrat at the House Committee on Education and the Workforce urged House Speaker John Boehner to immediately bring the bill to vote in the House.

Some critics of the deal said it did not do enough to protect borrowers from paying exorbitant rates when market interest rates rise sharply.

Democratic Senator Barbara Boxer of California said that plan is worse than what would happen under the current law, because rates could go higher than today’s rate of 6.8 percent.

But lawmakers voted against any amendments such as one by Democratic Senators Jack Reed of Rhode Island and Elizabeth Warren of Massachusetts that sought to cap undergraduate rates at 6.8 percent for undergraduates and 7.9 for graduate and parent loans.

“This permanent, market-based plan makes students’ loans cheaper, simpler and more certain,” said Alexander, the senior Republican on the U.S. Senate education committee. “It ends the annual game of Congress playing politics with student loan interest rates at the expense of students planning their futures.”