"This is the result of months of civil diplomacy carried out by our organisation," a spokesman for the Turkish charity the Humanitarian Relief Foundation (IHH), Serkan Nergis, said in Turkey.
The regime's prisoners exchanged for the Iranians were of several nationalities, including Turks, he said.
A spokesman for the rebel Free Syrian Army, Ahmed al-Khatib, confirmed the deal, telling AFP in Beirut by telephone it was worked out through Turkish and Qatari mediation with Iran lobbying ally Syrian President Bashar al-Assad.
Iranian television made no mention of the swap deal, saying only that "the 48 Iranian pilgrims were released."
The Iranians counted several Revolutionary Guards members, according to the rebel group which snatched them in Damascus in early August and threatened them with execution.
The rebels released a video on August 5 showing the captives and Iranian military identification cards taken from them.
Iranian Foreign Minister Ali Akbar Salehi on August 8 admitted there were Revolutionary Guards in the group, but claimed they were "retired".
Salehi had said all 48 had been on a religious pilgrimmage to a Shiite shrine in southeast Damacus, rejecting suspicions the Iranians had been providing military support to Assad's forces.
Wednesday's prisoner release was not immediately confirmed by Turkish or Syrian officials.
Separate to the abduction, Iran's Revolutionary Guards acknowledged on September 16 that members of its Quds Force, an elite external operations unit, had been dispatched to Syria.
But Guards commander General Mohammad Ali Jafari told journalists the Quds deployment was there only to "counsel" Syrian forces fighting insurgents, and not for combat.
Salehi's foreign ministry days later stressed that Jafari's admission did not in any way mean that Iran had a "military presence" in Syria.
Iran has said it is providing only economic and humanitarian aid to Syria's regime, which it sees as part of a regional "resistance" to Israel.
The United States and its Western allies believe that Iran is also providing weapons, snooping technology and military personnel skilled in hunting down and suppressing opposition members.