The Senate on Wednesday approved a bipartisan deal that ensures lower interest rates on loans for students heading to college this fall.

Senators voted 81 to 18 to lower interest rates for undergraduates taking out government loans this school year to 3.86% -- cheaper than the 6.8% interest rate that kicked in on July 1. The new rates would be retroactive and apply to loans taken out after July 1.

However, the bill has provisions for rates to go higher in coming years. It is expected to become law, with support from the White House and the House of Representatives, which will likely take up the bill in coming days.

"This fall, all undergraduates, subsidized or unsubsidized, would only have to pay 3.86% interest rate for the life of the loan," said Sen. Tom Harkin, an Iowa Democrat, whose support was key to a Washington deal. "That means real savings for borrowers."

It doesn't apply to loans that students get from private lenders. It only affects Stafford loans, which are made by the U.S. government to help finance a college education. Students can apply through their university financial aid office. The loans are limited to no more than $5,500, for a mix of subsidized and unsubsidized loans for the freshmen year and $7,500 for juniors and above.

On July 1, the interest rate on subsidized Stafford loans doubled from 3.4% to 6.8%. The rate hike affected 7.4 million students. The subsidized government student loans are based on financial need and account for about 26% of all federal student loans, according to the Congressional Budget Office.

Unsubsidized loans and graduate loans were already paying 6.8% interest rates.

The latest bill helps all students.

The basic principle is that it ties student loan rates to the bond markets.

This fall, undergraduate students will pay an overall interest rate of 3.86% on their loans. It is comprised of the yield on the 10-year Treasury note on June 1, plus an additional 2.05%. Graduate students will have to pay 5.41% on loans this fall, or 3.6% over the 10-year Treasury, also on June 1.

Related: Bill helps college students now, but future students to see rate hikes

If rates on Treasury notes rise, so would student loan rates under the new deal.

However, if interest rates were to spike, the bill makes provisions to cap the rates. Loans for undergraduates will be capped at 8.25% and for graduates at 9.5%.

Over 10 years, the interest rates the government collects on student loans is expected to raise $715 million. It will go toward reducing deficits.

The bill won support from Senate Republicans. However, left-leaning Democrats and student groups opposed the bill for hiking rates in coming years.

"The truth of the matter is the bill on the floor would be a disaster for the young people of our country who are looking to go to college," said Sen. Bernie Sanders, a Vermont Independent who opposed the bill. "This makes a bad situation worse."

Under the deal, high school students, like Dakota Friend, 16, could be paying more for student loans when she attends college. However, it will benefit her sister, Briana Mullen, who is currently a rising junior at University of California, Berkeley.

"It doesn't seem fair," Dakota Friend said. "I don't understand why she (my sister) gets the more affordable loans than I do."

President Obama has been pushing for the deal. Education Secretary Arne Duncan said Tuesday that he was "really pleased that Congress is coming together to keep college student loans rate low."

Related: Student loan horror stories

Student loan debt has skyrocketed in recent years, as have delinquencies, making it a pressing political and financial issue for millions of Americans. Many students graduate from college deep in debt and without jobs. It is second only to mortgages as the largest debt that consumers carry. In 2011, students on average owed nearly $27,000 in loans.

-- CNN's Ted Barrett and Deirdre Walsh contributed to this piece.