WASHINGTON — The United States has about 11,000 troops in Afghanistan, the Pentagon said on Wednesday, acknowledging for the first time publicly that the total forces there are higher than formally disclosed in recent years.

Previously, Defense Department officials had said 8,400 troops were in Afghanistan as part of NATO’s Resolute Support mission. An additional 2,000 American troops, which military officials have not publicly acknowledged, are in Afghanistan to help local forces conduct counterterrorism missions.

The new count includes covert as well as temporary units, defense officials said.

The disclosure came after Defense Secretary Jim Mattis expressed frustration with how troops in war zones were counted. To get around Obama-era restrictions on the number of troops in Iraq and Afghanistan, commanders sometimes resorted to ad hoc arrangements.

“The secretary has determined we must simplify our accounting methodology and improve the public’s understanding of America’s military commitment in Afghanistan,” said Dana W. White, the Pentagon’s chief spokeswoman.