WASHINGTON — Congress took the government out of the job of setting student loan rates Wednesday when the House of Representatives passed a bill that leaves the work to markets.

The bill now heads to President Barack Obama, who is expected to sign the measure. It will mean that most students will pay less interest on loans they take out this year because all rates are near historic lows. Undergraduates will pay 3.86 percent this year, down from 6.8 percent under current law.

Yet rates are expected to go up in the future as the economy improves and the money-lending markets shift accordingly.

With the cost of college zooming up, increasing numbers of people have taken on more college debt.

The final votes were a rare example of bipartisanship. The House vote was 392-31. Obama supports the legislation and the White House lobbied for it before the Senate approved it last week, 81-18.

“We wanted to get out of the partisan political squabble that was occurring in this city every year as we tried to figure out through some alchemy what the student loan interest rate should be,” said Rep. John Kline, R-Minn., the chairman of the House Education and the Workforce Committee.

Democrat George Miller of California took a similar stance.

“This is a big and important step in terms of college affordability for students,” he said.

Under the new loan system, interest rates on all student loans will be based on the 10-year Treasury borrowing rate plus 2.05 percentage points for undergraduate loans. There’s an add-on of 3.6 points for graduate loans and 4.6 points for PLUS loans, which are additional loans that graduate students and parents of undergraduates can borrow. The add-ons cover the cost of the loan program.

The interest rate on graduate loans will be 5.41 percent next year and PLUS loans 6.41 percent. The rates had been 6.8 percent and 7.9 percent, respectively.

All rates are fixed for the life of a loan.

The rate on subsidized loans went up from 3.4 percent to 6.8 percent on July 1 under the current law. Unsubsidized undergraduate loans already had been 6.8 percent, and most students take out both types. The new system sets a single rate for all undergraduate loans.

Rates for all types of student loans will be set once a year in the spring. They will not be able to rise above caps of 8.25 percent for undergraduate loans, 9.5 percent for graduate student loans and 10.5 percent for PLUS loans.