WASHINGTON — The House on Thursday passed legislation to head off a doubling of student loan interest rates on July 1, instead tying rates to prevailing market trends and ending federal subsidies.

The bill, approved largely along party lines, 221 to 198, kicks off what is sure to be the next showdown involving House Republicans, Senate Democrats and President Obama, with a hard deadline looming in little more than a month.

Republicans said they had come up with a long-term plan that would get the government out of the business of setting interest rates.

“What the House is doing today is a responsible way to deal honestly with the issue of student loans,” Speaker John A. Boehner of Ohio said. “Can somebody politicize this on the other side of the aisle? Certainly they can.”