WASHINGTON – Student borrowers will see interest rates reduced to levels near those that expired last month under a deal announced by lawmakers Thursday, potentially ending a battle over college costs that had divided Democrats and threatened to leave students with sharply higher costs.

The legislation offered by a bipartisan group of senators largely follows the approach initially outlined by the Obama administration, which would base student loan rates on the 10-year Treasury note rate.

Under the deal, each loan would carry a fixed rate. According to estimates provided by the bill’s authors, the rate for all undergraduate student loans would be 3.86% this year. The rates at which loans would be offered in subsequent years would adjust with the bond market. They are forecast to reach 7.25% by 2018 as interest rates go up with an improving economy. The plan would cap the rate at 8.25% on undergraduate loans to protect against increases beyond current forecasts.

The new rates would be slightly higher on loans taken out by graduate students and parents. All rates will be retroactive to July 1, when the old fixed rate of 3.4% expired.

The Senate could vote on the plan early next week. Speaker John A. Boehner indicated that approval in the House could follow shortly after.

“While this isn’t the agreement any of us would have written – and many would like to see something quite different – I believe we have come a long way in reaching common ground on a very difficult and challenging topic,” Sen. Richard J. Durbin (D-Ill.) said at a news conference attended by the measure’s bipartisan sponsors.

“This is a long-term problem with a long-term fix,” said Sen. Joe Manchin III (D-W.Va.), who said students would save $27 billion in interest payments over the next four years under the plan.

A market-based system had been used to calculate student borrowing rates until Congress passed legislation that took effect in 2006 and put a fixed rate of 6.8% on all subsidized Stafford loans. Legislation passed after Democrats took control of both the House and Senate in 2007 gradually lowered that rate to 3.4%.

That reduction was meant to be temporary, but President Obama and his party successfully sought an extension, arguing in the midst of the 2012 campaign that it would hurt middle-class students to raise borrowing costs in a slowly improving economy.

Unity among Democrats on the issue was tested this year as rates were again set to double. The Republican-led House passed its own version of a market-based plan in May, saying it mirrored what Obama had proposed in his budget. Senate Democrats, meanwhile, twice failed to muster the votes to end a filibuster and pass a one-year extension of the 3.4% rate as some in the party supported an alternative Republican plan.

Attempts to bridge differences between the contending positions failed to produce a deal before the June 30 deadline. A key stumbling block was how a cap on rates should be structured, and how much revenue would be generated by the new rates. Democrats argued that profits to the federal government should be limited, while Republicans insisted that any plan be at least deficit-neutral. The final agreement would generate $715 million for the government over 10 years, a considerably smaller amount than previous plans.

Talks continued this month, including an hourlong meeting between senators and the president at the White House on Wednesday. The final agreement also calls for a broader government study of college costs that would take into account subsidies such as Pell Grants. The study was requested by Sen. Tom Harkin (D-Iowa), who chairs the Health, Education, Labor and Pensions Committee and had been resistant to a market-based plan.

Harkin later told reporters that the findings of the study could lead him to again consider additional interest rate subsidies next year when his committee considers a new five-year higher education bill.

“We have the authority,” he said. “This is not the Ten Commandments written in stone.”