Cash-strapped college students can breathe a bit easier, as the Senate approved a bipartisan bill Wednesday night that would allow them to avoid higher interest rates on federal loans.

The measure calls for rates to be linked with the financial markets, meaning they likely will increase in future years as the economy improves, as expected.

Many Democrats, including Senate Majority Leader Harry Reid of Nevada, initially opposed the plan, preferring to continue the current system of locking in rates. But after caps were set on how high rates could climb, enough Democrats went along with the deal, which passed by a vote of 81-18.

House Speaker John Boehner on Wednesday night praised the measure, saying it's consistent with a House Republican version passed in May.

President Obama called the comprise package "a major victory for our nation's students."

The interest rate on new federally subsidized Stafford loans jumped to 6.8 percent on July 1 from 3.4 percent after Congress failed to agree on a plan to keep the rates from rising. The increase meant an extra $2,600, on average, for students.

Reid wanted a one or two-year rate freeze of 3.4 percent, while limiting loans to only students who demonstrated financial need. But after the Senate rejected his plan earlier this month, a handful of Democrats broke ranks and hammered out a proposal with Republicans that tied loan rates to the 10-year Treasury note and allowed all students -- regardless of their financial situation -- to borrow money from the federal government at discount rates.

Reid signed off on the deal last week but allowed votes on amendments.

The measure would let all undergraduates borrow money at a 3.9 percent interest rate, while graduate students would pay 5.4 percent. Those rates would climb as the economy improves and it becomes more expensive for the government to borrow money.

Rates for undergraduates would be capped at 8.25 percent, while the rate for graduate students would not climb higher than 9.5 percent.

The bill's supporters say the new loan structure would offer lower rates to 11 million borrowers right away and save the average undergraduate $1,500 in interest charges on loans they take out this year.

"In just a few short weeks, students will be returning to school knowing with certainty what their interest rates will be on their loans for the upcoming school year," said Sen. Joe Manchin, D-W.Va., a lead negotiator in brokering the compromise. "I thank my colleagues on both sides of the aisle for coming together to pass this commonsense, long-term fix."

Many liberal Democrats were unhappy with the package, calling it a bait-and-switch because rates likely will jump in subsequent years.

"A college education should be a path to prosperity, a path to the middle class, not a path to indebtedness," said Sen. Tammy Baldwin, D-Wis. "Not only does this legislation raise long-term loan rates for students, it fails to close tax loopholes and does not ask the wealthy to pay their fair share."

Sen. Bernie Sanders, a Vermont independent who caucuses with Democrats, called the White House "disingenuous" for downplaying that the probability loan rates will increase.

Sixteen Democrats and Sanders voted against the bill. Conservative Sen. Mike Lee of Utah was the lone Republican to reject it.