The exchange, brokered by Turkey and Qatar, came days after Mr. Assad warned on Sunday that he would not abandon the fight against armed adversaries pressing on the approaches to the Syrian capital, Damascus, and brushed aside calls for him to quit.
Word of the exchange dominated news in Iran, the Syrian government’s only Middle East ally, leading the Web site of the official Islamic Republic News Agency. Iran state television showed a brief clip of the released hostages at the Sheraton Hotel in Damascus, grinning, flashing victory signs and holding flowers. In an interview on Iran state TV, the Foreign Ministry spokesman, Ramin Mehmanparast, thanked those involved in the swap for the hostages and expressed happiness that “we managed to get them released.”
Precise details of the exchange, including when the 48 Iranians would be repatriated, remained unclear. Mr. Mehmanparast also said two Iranian engineers who had been abducted earlier in Syria remained captive. But Prime Minister Recep Tayyip Erdogan of Turkey, a regional power broker allied to the Western and Arab nations seeking Mr. Assad’s departure, said he hoped the exchange on Wednesday would lead to freedom for more prisoners in Syria.
“We wish many other innocent people, and people in need, to be released from Syrian jails without delay,” Mr. Erdogan said in a televised news conference in Niamey, Nigeria, where he arrived on an official visit.
“This process needs to be appreciated. We are not in a position to say anything more than, ‘May this produce some good.’ ”
The exchange emerged from months of behind-the-scenes negotiations involving a Turkish charitable foundation, the Humanitarian Relief Foundation, an Islamist-leaning aid organization based in Istanbul and widely known as I.H.H.
The aid group had set up an operation center in Damascus to unite 2,130 prisoners, including 73 women, at one base while another aid team remained in Douma, near the Syrian capital, to oversee the return of the 48 Iranians.
“Captivity is a hard thing,” said Bulent Yildirim, the foundation’s director, who coordinated the exchange in Damascus.
“I saw young women crying, many people lost a lot of weight, and there were also many sick people.”
The Syrian opposition has claimed that the Iranians are members of Iran’s Islamic Revolutionary Guards Corps, but Tehran has denied the assertion, saying the captives are Shiite civilian pilgrims. The Iranians were seized in August while traveling on a bus from Damascus International Airport to a Shiite shrine on the outskirts of the capital, Iran’s Press TV said.
Opposition fighters had threatened to kill the Iranians unless Mr. Assad’s forces halted military operations. But since then the fighting around Damascus has intensified.
Iran is Mr. Assad’s main ally in a region where most Arab states and neighboring Turkey have turned against him. The Iranian captives offered the rebels holding them a source of powerful pressure on the Syrian leader to release opposition prisoners in return.
“We expect the swap to be completed in the next hour,” Huseyin Oruc, a member of the aid group’s executive board said in a telephone interview around midday. He said the captives released by the Syrian authorities included four Turks and a Palestinian.
By midafternoon it was not clear whether the 2,130 prisoners had been freed.
“It is the first time that the ‘humanitarian diplomacy’ we initiated succeeded in releasing such a large group of people at once,” Mr. Oruc said. “There are many more held captive and our efforts to free them will continue without delay.”
The Turkish aid group gained international attention in 2010 for organizing a flotilla of boats heading to Gaza, ostensibly with relief supplies, that prompted a deadly Israeli commando raid in which eight Turks and an American of Turkish descent died. At the time of the raid, the group was reported to have extensive connections with Turkey’s political elite. The episode began an unraveling of Turkey’s once close ties with Israel.
In recent months, the organization has also been part of negotiations to free smaller numbers of prisoners, including two Turkish journalists held in Syria, Reuters reported. It has been active since the early 1990s in charitable works in the Middle East and Africa, focusing most recently on Gaza.
Since the start of the uprising against Mr. Assad, the organization has also cast itself as a leading private charitable organization in Syria, delivering food and other basic supplies and pursuing what it calls “humanitarian diplomacy” to help free captive civilians.
While the numbers involved in Wednesday’s exchange seemed dramatic, some rebel commanders said more modest prisoner exchanges had become a feature of the conflict.
The leader of a rebel fighting group in the central city of Hama, reached via Skype, said pro-government militia members had captured his uncle and two other relatives in a village in the northern Idlib province more than a month ago.
“The only way to release them is capturing hostages,” the commander said, adding that negotiations were under way to win the release of his relatives in return for 12 captives held by the rebels. Two months ago, the commander said, nine members of the pro-government militia, known as shabiha, were exchanged for five captured rebels. Syria’s uprising began in March 2011 with peaceful demonstrations, but a harsh suppression broadened into civil war with an estimated 60,000 people killed, according to United Nations estimates.
Sebnem Arsu reported from Istanbul and Alan Cowell from London. Hwaida Saad contributed reporting from Beirut, Lebanon, and Thomas Erdbrink from Tehran.