BAGRAM AIR FIELD, Afghanistan - U.S. Defense Secretary Ash Carter said Tuesday that the decision to give U.S. commanders more authority to work with Afghan troops and strike the Taliban will maximize the use and effectiveness of American forces in Afghanistan.

Carter is in Afghanistan to meet with U.S. commanders in the wake of a pledge by NATO allies to keep troop levels stable as they battle a resilient Taliban. The U.S. currently has about 9,800 troops in Afghanistan. Earlier, the U.S. had planned to reduce the number of troops from 9,800 to 5,500 by the end of 2016, but a resurgent Taliban changed the White House's thinking.

Speaking during a press conference with Afghan President Ashraf Ghani, Carter also said that progress by the Afghanistan government on economic and anti-corruption reforms "is central" to the continued international support for the country.

Get Breaking News Delivered to Your Inbox

Ghani said his government is working to remove corruption and also on the economic reforms.

This is Carter's second stop in a war zone in as many days, part of a weeklong trip that has underscored America's growing commitment to two wars that President Barack Obama inherited but has not been able to end. On Monday in Iraq, Carter announced that the U.S. would be sending 560 additional troops there in the coming days and weeks.

In Afghanistan, Carter was scheduled to meet with Ghani and the country's chief executive officer, Abdullah Abdullah, as well as the top U.S. commander in Afghanistan, Army Gen. John W. Nicholson.

Nicholson told reporters that he will have 3,000 U.S. troops working as advisers in Afghanistan, 2,150 troops doing counterterrorism and 3,300 working in a supporting role as enablers. In addition, he said he will keep "some hundreds" of forces "over the horizon" out of the country that will be considered part of the NATO mission to advise and assist Afghan forces.

Nicholson also said he is making daily use of the expanded authorities Obama granted him in June to work with Afghan forces and to conduct offensive operations against the Taliban under certain circumstances.

Obama announced last week that he would keep 8,400 U.S. troops in Afghanistan after this year, rather than cut their numbers to 5,500 as he once planned. In addition to taking part in the NATO advisory-and-assist mission, the U.S. has special operations forces in the country that conduct counterterrorism missions.

The planned force levels allow NATO allies to remain in regional hubs around Afghanistan, with Germany in the north, Italy in the west, Turkey in the capital of Kabul and the United States in the east and south.

Earlier plans to consolidate forces in Kabul and Bagram were scrapped amid resurgent Taliban fighting and the growing presence of Islamic State of Iraq and Syria (ISIS) militants, including many that simply switched allegiance from one insurgent group to another.

U.S. Army Gen. Curtis Scaparrotti, the top NATO commander, told reporters at the NATO meeting that the Afghan mission is key to global security.

"We know that there are al Qaeda and (ISIS) components in Afghanistan," he said. "If we fail there we will certainly see that impact in our global counterterrorism campaign that we're executing. It will make it harder."

Obama came into office pledging to extract America from the nearly 15-year conflict. But with the Taliban gaining ground and it becoming clear that Afghan forces still needed U.S. and coalition support, he urged his fellow NATO leaders in Warsaw to expand their support for the war against the Taliban.

The U.S. has pledged to provide $3.5 billion annually to fund Afghan forces, and the government in Kabul is expected to contribute as much as $500 million. Allies would provide the remaining $1 billion. The funding would maintain a total of 352,000 Afghan Army troops and police officers.