WASHINGTON—Pakistan agreed Tuesday to reopen North Atlantic Treaty Organization supply routes to Afghanistan after U.S. Secretary of State Hillary Clinton apologized for the deaths of two dozen Pakistani troops in a November border clash, ending a seven-month standoff that complicated U.S. war aims.

The move was an about-face for the Obama administration, which had refused to say it was sorry for the Nov. 26 incident along the Afghanistan border.

"We are sorry for the losses suffered by the Pakistani military," Mrs. Clinton told Pakistani Foreign Minister Hina Rabbani Khar, according to a statement issued by the State Department. "We are committed to working closely with Pakistan and Afghanistan to prevent this from ever happening again."

The attack and its aftermath strained ties between the two countries and prompted Pakistan to close the land routes. That forced the U.S. to bring in supplies for troops by air and by a more expensive northern route through Russia, Central Asia and the Caucasus. Pakistan's closure of the supply routes cost the U.S. about $100 million extra a month, Defense Secretary Leon Panetta recently estimated.

The decision to issue an apology now was driven in large part by administration concerns about those mounting costs, as well as the realization that a smooth and timely withdrawal of heavy equipment from Afghanistan would depend on using land routes through Pakistan, U.S. officials said.