Between meetings, General Dunford toured the Parliament building that was damaged by helicopter gunfire and four bombs that were dropped from fighter planes while lawmakers were inside.

Hours before General Dunford’s visit, Turkish forces flying attack helicopters and drones raided a forested area in southwestern Turkey, capturing a fugitive unit of commandos who had tried to assassinate or kidnap President Recep Tayyip Erdogan last month during the attempted coup. The commandos had been on the run since early on July 16, when they attacked a seaside hotel in Marmaris where Mr. Erdogan had been vacationing.

The president slipped away just before the commandos’ helicopters arrived, however, in one of the most dramatic events in a night of violence that left more than 250 people dead. Residents of the Marmaris area were apparently boar hunting when they spotted the fugitive commandos, according to officials. “We thought there was suspicious activity when we saw the men in the forest,” a witness said in an interview on the private news channel CNN Turk. “But we knew for sure when the authorities showed us pictures of the men.”

In the overnight raid, special forces captured 11 commandos thought to have been part of the plot against Mr. Erdogan’s life, with one suspect still at large, Numan Kurtulmus, Turkey’s deputy prime minister, said in a news conference on Monday. More than a dozen other soldiers were already in custody and accused of being part of the operation on Mr. Erdogan’s hotel. Video footage showed suspects covered in bruises being loaded into armored vehicles as anti-coup demonstrators gathered in the area chanting, “Traitors! We want the death penalty!”

In recent days, new details have surfaced about what occurred during the coup attempt. A Turkish military official who is believed to have been part of the coup called General Dunford’s office shortly after it began, according to a Pentagon official. The person who answered the phone said that the general, who was traveling in Afghanistan, was not there. The military official then hung up the phone. The message was relayed to General Dunford in Afghanistan, who ultimately did not reach the official. The episode was first reported by BuzzFeed.

Almost immediately after the coup failed, Mr. Erdogan and his government began a vast purge of the military and state bureaucracy, arresting thousands of soldiers and dismissing tens of thousands of other state employees they accused of having links Mr. Gulen. Turkish officials have complained that Western leaders have focused more on denouncing Mr. Erdogan’s post-coup purges than on standing by Turkey as it suppressed the violent rebellion. Ankara was further annoyed when Mr. Erdogan was barred from addressing tens of thousands of Turks who gathered in Cologne, Germany, over the weekend to express support for the Turkish leadership.