The U.S. military's top leaders told lawmakers Tuesday that the thousands of additional U.S. troops President Trump has ordered to Afghanistan will cost just over $1 billion a year, bringing the total bill for fighting America's longest war to $12.5 billion annually.

During wide-ranging hearings on Capitol Hill, Defense Secretary Jim Mattis also said that the United States should remain in the nuclear deal negotiated during the Obama administration that constrains Iran's ability to build a nuclear arsenal. Mr. Trump has trashed the international accord, a cornerstone of Barack Obama's presidency, as the worst agreement ever negotiated by the United States and signaled he may abandon the agreement. Mr. Trump has yet to announce what he plans to do with the deal, after his first time at the United Nations General Assembly in September, even though he said he has "decided" what to do.

The release of the Afghan war cost information came as Sen. John McCain, R-Ariz., assailed Mattis and Marine Corps Gen. Joseph Dunford, the chairman of the Joint Chiefs of Staff, for withholding from Congress key details about Mr. Trump's new strategy for winning in Afghanistan that was announced six weeks ago.

McCain, the chairman of the Armed Services Committee, declared that it was "bizarre" that Mattis and Dunford did not submit written testimony before the hearing started. That's customary practice for administration witnesses testifying before congressional committees. The written testimony is usually released in advance, giving members of the committee time to digest the information and prepare questions.

Get Breaking News Delivered to Your Inbox

"We want to be your partners," McCain said. "But this committee will not be a rubber stamp for any policy or president. We must be well-informed. We must be convinced of the merits of the administration's actions. And unfortunately, we still have far more questions than answers about this new strategy."

McCain even told Defense News the committee will hold up the president's Pentagon nominations until members are satisfied with the administration's plans for Afghanistan and Iraq.

Mattis and Dunford, who appeared first before the Senate panel and later before the House Armed Services Committee, sought to assure skeptical lawmakers that Mr. Trump's plan for expanding the U.S. presence in Afghanistan would pay off. Several members expressed concern the U.S. was wading more deeply into a conflict at great expense without prospects for long-term success.

Mattis said that the Afghanistan military and police forces are fully engaged in combat operations for the first time during the 16-year-old war and are suffering fewer casualties as they continue to improve their competence on the battlefield.

He added that the Afghan forces are becoming bolder in combat because they know U.S. and NATO forces are using airpower to strike the Taliban and other militants on "the high ground." That frees up the Afghans to "take the fight to the enemy," Mattis said.

Dunford acknowledged, however, that the war in Afghanistan is currently a stalemate.

"We're not at a point where we can bring a successful political solution to the war," Dunford said.

Trump unveiled his new strategy for Afghanistan in August and said American troops would "fight to win" by attacking enemies, "crushing" al-Qaida, and preventing terrorist attacks against Americans. But Mr. Trump said U.S. support is not unlimited.

"Our commitment is not unlimited and our support is not a blank check," he said at the time.

But Mr. Trump's description of a win in Afghanistan notably did not include defeating the Taliban. He indicated that after an effective military effort it eventually may be possible to reach a political settlement in Afghanistan that includes elements of the Taliban.

As part of the plan, the Pentagon is boosting troop numbers by about 3,500, augmenting the roughly 11,000 Americans currently stationed there. The increase will expand training of the Afghan military and beef up U.S. counterterrorism operations against al Qaeda and a growing Islamic State of Iraq and Syria (ISIS) affiliate in Afghanistan, as well as the Taliban and other extremist groups.

The White House delayed the president's Afghanistan announcement for weeks, as it hammered out the details.

The Special Inspector General for Afghanistan has long questioned the effectiveness of the resources spent on that war. The watchdog has called out everything from up $28 million wasted on "inappropriate" Afghan soldier uniforms, to $450 million wasted on a spy program under the Obama era.

The additional cost of the war comes as the president criticizes costs elsewhere. On Tuesday, while visiting Puerto Rico, the president joked the island is throwing the budget a "little out of whack" in the wake of Hurricane Maria, and his administration is fighting to explain how its new tax proposal doesn't add to the federal deficit.