Afghanistan President Hamid Karzai speaks during a meeting with the family members of civilians killed by U.S. soldier in Kandahar last week at the presidential palace in Kabul. (OMAR SOBHANI/REUTERS)

In formal negotiations set to begin Thursday, Afghan officials are expected to press their U.S. counterparts for veto power over controversial night raids on Afghan homes as well as warrants signed by a judge before the operations are carried out.

Despite substantive differences, officials on both sides expressed confidence that they are heading toward an understanding on the raids that will allow them to complete within two months a broader accord governing the long-term military relationship between the countries.

The officials spoke on the condition of anonymity to discuss the sensitive talks.

Afghan President Hamid Karzai has long insisted on an end to the raids, which U.S. commanders consider one of their most effective tools against Taliban insurgents. Karzai repeated his demand in angry remarks last week after a March 11 shooting rampage, allegedly carried out by a U.S. soldier, that left 16 Afghan civilians dead.

“We saw his comments, but we’ve been reassured . . . since then,” a senior U.S. defense official said of Karzai. This official and others attributed the easing of tensions to a Friday telephone call and other recent conversations between Karzai and President Obama.

Both sides see the shooting and its aftermath as a watershed that has gotten them to move forward on the night-raid negotiations and other issues, although for different reasons.

From Afghanistan’s perspective, the incident gave the Americans a glimpse of the kinds of disasters that were increasingly likely if the two sides remained at loggerheads.

U.S. officials view it as evidence that the relationship is sturdy enough not to collapse even under the most trying circumstances. Although the administration does not characterize its evolving positions as concessions, its rhetoric on the night raids has softened.

The White House said this week that requiring judicial warrants was a “reasonable” Afghan expectation.

Whether U.S. negotiators in Kabul will determine that Afghan veto power over the raids is similarly reasonable is uncertain. Officials declined to discuss what one of them described as Afghanistan’s opening position in the talks.

Karzai has deemed the more than 2,000 night operations conducted by U.S. Special Operations forces last year as a violation of Afghan sovereignty and culture — and a cause of civilian casualties. U.S. commanders have said that all the raids are conducted in partnership with Afghan forces as part of the gradual transition to Afghan security control throughout the country, due to be completed next year.

In congressional testimony this month, Adm. William H. McRaven, head of the Special Operations Command, said, “Afghan special forces are in the lead on all of our night operations . . . surrounding a particular compound, trying to call out the specific individual — and the first forces through the door.”

Afghan officials say that they are “in the lead” in about 60 percent of the raids but that U.S. troops are effectively in control of all of them because they provide the intelligence on which targets are selected and which operations are planned, often without giving that information to Afghan partners in advance.

U.S. forces also provide the logistics, including specialized helicopters, that make the raids possible.

Without these capabilities, the Afghans say, the only way they can be in charge of the operations, with U.S. forces in a supporting role, is with full information that allows them to approve, or veto, the raids in advance.

Karzai also called for U.S. withdrawal from Afghan towns and villages where small Special Operations units are organizing local protection forces.

But in subsequent explanations, Afghan officials have said that they see this pullback as part of the ongoing transition process, in which U.S. troops would withdraw from villages as Afghan units grow capable of standing on their own.

Although opinion polls show that a majority of Americans now favor an early withdrawal from Afghanistan, the Afghans say they do not want to speed the overall departure of foreign troops.

Instead, they say, they want to accelerate the transition process so they can test their security wings while foreign troops remain to back them up.

This month, U.S. and Afghan officials signed a memorandum of understanding on a process to transfer detainees and American-run prisons to Afghanistan’s control. A similar agreement on night raids would remove the remaining stumbling block to the separate, long-term strategic partnership agreement.

Obama has said that he hopes the long-term accord can be signed before a NATO summit scheduled for May in Chicago. That agreement will set the terms for a U.S. military presence in Afghanistan beyond NATO’s planned withdrawal of all international combat troops by the end of 2014.

Pentagon officials are planning for a follow-on force, numbering 5,000 to 30,000 troops, including training, support and counterterrorism units that would be based inside military posts flying Afghan flags.

The agreement, assuming it is ready by mid-May, is unlikely to contain any troop numbers, officials said. Instead, it will commit the two sides to negotiating the details of a 10-year, renewable security arrangement before the December 2014 NATO deadline.