KABUL, Afghanistan (AP) — U.S. military deaths in the Afghan war have reached 2,000, a cold reminder of the human cost of an 11-year-old conflict that now garners little public interest at home as the United States prepares to withdraw most of its combat forces by the end of 2014.

The toll has climbed steadily in recent months with a spate of attacks by Afghan army and police — supposed allies — against American and NATO troops. That situation has raised troubling questions about whether countries in the U.S.-led coalition in Afghanistan will achieve their aim of helping the government in Kabul and its forces stand on their own after most foreign troops depart in little more than two years.

On Sunday, a U.S. official confirmed the latest death, saying that an international service member killed in an apparent insider attack by Afghan forces in the east of the country late Saturday was American. A civilian contractor with NATO and at least two Afghan soldiers also died in the attack, according to a coalition statement and Afghan provincial officials. The U.S. official spoke on condition of anonymity because the nationality of those killed had not been formally released. Names of the dead are usually released after their families or next of kin are notified, a process that can take several days. The nationality of the civilian also was not disclosed.

In addition to the 2,000 Americans killed since the Afghan war began on Oct. 7, 2001, at least 1,190 more coalition troops from other countries also have died, according to iCasualties.org, an independent organization that tracks the deaths.

According to the Afghanistan index kept by the Washington-based research center Brookings Institution, about 40 percent of the American deaths were caused by improvised explosive devices. The majority of those were after 2009, when President Obama ordered a surge that sent in 33,000 additional troops to combat heightened Taliban activity. The surge brought the total number of American troops to 101,000, the peak for the entire war.

According to Brookings, hostile fire was the second-most-common cause of death, accounting for nearly 31 percent of Americans killed.

Tracking deaths of Afghan civilians is much more difficult. According to the U.N., 13,431 civilians were killed in the Afghan conflict between 2007, when the U.N. began keeping statistics, and the end of August. Going back to the U.S.-led invasion in 2001, most estimates put the number of Afghan civilian deaths in the war at more than 20,000.

The number of American dead reflects an Associated Press count of those members of the armed services killed inside Afghanistan since the U.S.-led invasion began. Some other news organizations use a count that also includes those killed outside Afghanistan as part of Operation Enduring Freedom, the global anti-terror campaign led by then-President George W. Bush.

The 2001 invasion targeted al Qaeda and its Taliban allies shortly after the Sept. 11 attacks on the United States, which claimed nearly 3,000 lives.

Victory in Afghanistan seemed to come quickly. Kabul fell within weeks, and the hard-line Taliban regime was toppled with few U.S. casualties.

But the Bush administration’s shift toward war with Iraq left the Western powers without enough resources on the ground, so by 2006 the Taliban had regrouped into a serious military threat.

Mr. Obama deployed more troops to Afghanistan, and casualties increased sharply in the past several years. But the American public grew weary of having its military in a perpetual state of conflict, especially after the withdrawal of American troops from Iraq at the end of last year. That war, which began with a U.S.-led invasion in 2003 to oust Saddam Hussein, cost the lives of nearly 4,500 U.S. troops, more than twice as many as have died in Afghanistan so far.

“The tally is modest by the standards of war historically, but every fatality is a tragedy and 11 years is too long,” said Michael O’Hanlon, a fellow at the Brookings. “All that is internalized, however, in an American public that has been watching this campaign for a long time. More newsworthy right now are the insider attacks and the sense of hopelessness they convey to many. “

Attacks by Afghan soldiers or police — or insurgents disguised in their uniforms — have killed 52 American and other NATO troops so far this year.

The so-called insider attacks are considered one of the most serious threats to the U.S. exit strategy from the country. In its latest incarnation, that strategy has focused on training Afghan forces to take over security nationwide — allowing most foreign troops to go home by the end of 2014.

Although Mr. Obama has pledged that most U.S. combat troops will leave by the end of 2014, American, NATO and allied troops are still dying in Afghanistan at a rate of one a day.

Even with 33,000 American troops back home, the U.S.-led coalition will still have 108,000 troops — including 68,000 from the U.S. — fighting in Afghanistan at the end of this year. Many of those will be training the Afghan National Security Forces that are to replace them.

“There is a challenge for the administration,” Mr. O’Hanlon said, “to remind people in the face of such bad news why this campaign requires more perseverance.”

Associated Press writers Heidi Vogt and Rahim Faiez in Kabul and researcher Monika Mathour in Washington contributed to this report.