The exchange came just days after Assad vowed to press ahead with the fight against rebels despite international pressure to end the bloodshed that has left more than 60,000 people dead.
Iran is one of Assad's main backers and the Iranians, who were seized outside Damascus in August, were a major bargaining chip for factions trying to bring down his regime.
The group of 48 men arrived at the Sheraton hotel in several vans escorted by Syrian security forces. Iran's ambassador in Damascus, Mohammad Riza Shibani, greeted them with hugs and flowers.
Rebels claimed the captives were linked to Iran's powerful Revolutionary Guard, but Tehran has denied that, saying the men were pilgrims visiting Shiite religious sites in Syria.
Shibani said their release was a result of elaborate and "tough" negotiations, but he did not provide any other details of the deal. The Syrian government, which rarely gives details on security related matters, had no official comment and it was not clear what prompted the exchange.
The rebels had threatened to kill the captives unless the Syrian regime halted military operations against the opposition.
A spokesman for a Turkish Islamic aid group that helped coordinate the release said the regime had agreed to release 2,130 people in exchange for the Iranians.
Turkish Prime Minister Recep Tayyip Erdogan, speaking at a news conference during a visit to Niger, said four Turks and "a number of Palestinians" were among the prisoners being released by Syria.
He said one Turkish and one Qatari aid organization helped broker the deal, and that Turkey had been talking with the rebels.
"The rebels had made some preliminary preparations for the release, but we did not know what the Syrian reaction would be. In the end, it seems that they agreed," he said.
"There are still people being held in prisons and who are being aggrieved. Let's hope that they may be released as well and let's hope that the process is beneficial for all," Erdogan said. The news conference was broadcast live on Turkish television.
There were conflicting reports about how many of the prisoners in Syrian custody had been freed. Speaking in Istanbul, Umit Sonmez of the Foundation for Human Rights and Freedoms and Humanitarian Relief said the 48 Iranians were handed over to aid workers soon after the Syrian regime let a group go.
Sonmez said the Syrian prisoners included "ordinary people or friends or relatives of the rebels."
"This is the largest prisoner exchange to date," Sonmez said. "We are pleased that people from all sides who were held and victimized have finally been freed."
Turkey's state-run agency Anadolu Agency also said a group of people, including women and children, held in the Syrian Interior Ministry building in Damascus had been released and were escorted onto buses. The report could not immediately be confirmed.
Bulent Yildirim, the head of the Turkish aid organization, told Anadolu in Damascus that 1,000 people have been released so far, including 74 women and a number of children between the ages of 13 and 15.
An official in Syria's Interior Ministry said Wednesday that a group or prisoners would be released later in the day from the police headquarters in Damascus. But the official, who requested anonymity because he was not authorized to give official statements, declined to say whether the release was related to the freed Iranians.
The reported deal would mark the first major prisoner swap since the uprising against Assad began in March 2011.
Regime forces and rebels have exchanged prisoners before, most arranged by mediators in the suburbs of Damascus and in northern Syria, but the numbers ranged from two to 20 prisoners. The Syrian Red Crescent also has arranged exchanges of bodies from both sides.
(Copyright 2013 by The Associated Press. All Rights Reserved.)