WASHINGTON — Pakistan told the United States that it would reopen NATO’s supply routes into neighboring Afghanistan after Secretary of State Hillary Rodham Clinton said she was sorry for the deaths of two dozen Pakistani soldiers in American airstrikes in November, officials from the two countries said Tuesday.

The agreement ended a bitter seven-month stalemate that threatened to jeopardize counterterrorism cooperation, complicated the American troop withdrawal from Afghanistan and cost the United States more than $1 billion in extra shipping fees as a result of having to use an alternative route through Central Asia.

Mrs. Clinton said that in a telephone call on Tuesday morning to Pakistan’s foreign minister, Hina Rabbani Khar, they had agreed that both sides made mistakes that led to the fatal airstrikes.

“We are sorry for the losses suffered by the Pakistani military,” Mrs. Clinton said in a statement that the State Department issued but that officials said had been coordinated with her Pakistani counterpart. “We are committed to working closely with Pakistan and Afghanistan to prevent this from ever happening again.”