A bipartisan group of senators was close to reaching an agreement Thursday on how to set federal student loan interest rates, but then they learned that their plan could cost the government $22 billion over the next decade. That restarted negotiations yet again.

Senate Democrats have pushed for interest rates that benefit students over the long term, especially as market rates soar, without profiting the government. Republicans have sought rates that move with the market and don’t cost the government.

That plan would have tied interest rates to the market. It also would have capped rates at 8.25 percent for undergraduates and 9.25 percent for all other loans, according to two aides with knowledge of the negotiations.

For the coming school year, that would have meant undergraduates who take out new federal loans would see interest rates of about 3.6 percent, while rates for graduate students would be about 5.2 percent and for parents would be about 6.3 percent, according to the aides. That would have been a decrease for everyone, as rates now are 6.8 percent for undergraduates and 7.9 percent for graduate students and parents.

The tentative agreement was the result of discussions between Sen. Tom Harkin (D-Iowa), chairman of the education committee, Majority Whip Richard J. Durbin (D-Ill.) and six senators who had previously sponsored a similar bill.

Senators involved with the plan hope that they can tweak these numbers and find a plan that both parties can agree upon, according to the aides. They were confident that this development would not derail the negotiations.

On Tuesday, a bill that would have extended a 3.4 percent interest rate on one type of federal loan mostly taken out by low- and middle-income students failed to advance in the Senate. That rate expired July 1 and is now 6.8 percent.

The House passed a bill in May that would set these rates according to the market, up to 8.5 percent. Those rates could change over the life of a loan.

Lawmakers have been trying to reach a decision before the August recess, at which point many students will lock in on loans for the coming school year. White House and Education Department officials have had lengthy meetings with Senate leaders this week.