The United States said on Wednesday it appears to be on track to sign a strategic partnership agreement with Afghanistan charting their future relations during or before a late May NATO summit.

U.S. and Afghan officials have been trying to negotiate an accord for a long-term U.S. presence in Afghanistan beyond a 2014 deadline for most NATO combat forces to withdraw, allowing advisers and possibly some special forces to stay on.

The two countries earlier signed a deal on the transfer of a major U.S.-run prison to Afghan authority, leaving military raids on Afghan homes conducted at night as the final sticking point for reaching a deal.

We've made good progress the last few weeks, Secretary of State Hillary Clinton said at a news conference with Afghan Foreign Minister Zalmay Rasool, citing the detentions pact.

We are looking forward to finalizing the so-called night raids agreement. These are complicated issues but we are resolving them. We are clearing the way toward a strategic partnership agreement, she added. We would very much like to be in a position to sign such an agreement ... either before or at the Chicago summit and I think we are on track to do so.

More than a decade after Afghanistan's Taliban government was toppled following the September 11 attacks, the United States and its allies face a resilient insurgency, a weak Afghan government, and an uncertain future for Western support.

U.S.-Afghan relations have been badly strained this year by a March 11 incident in which a U.S. soldier is suspected of killing 16 Afghan civilians, including nine children, and by the burning of copies of the Koran at NATO's main base in the country, which sparked a week of rioting that left dozens dead.

U.S. efforts to promote peace talks between the Afghan government and the Taliban also appear to have bogged down.

On March 15, the Afghan Taliban said it was suspending nascent peace talks with the United States seen as a way to end the country's decade-long conflict, blaming shaky, erratic and vague U.S. statements.

The Taliban decision to suspend the talks was a blow to NATO hopes of a negotiated end to the war, which has cost the United States $510 billion and the lives of more than 1,900 soldiers.

Our only goal is to open the door for Afghans to sit down with other Afghans and to work out the future for their country, Clinton said, repeating U.S. demands that the Taliban break ties with al Qaeda, renounce violence and respect the Afghan constitution, including rights of women and minorities.

(Reporting By Arshad Mohammed; Editing by Jackie Frank and Vicki Allen)