President Hassan Rouhani vowed revenge on Thursday against the "mercenary group" behind a suicide bombing which killed 27 troops in southeastern Iran and accused the US and Israel of supporting "terrorism".

"We will certainly make this mercenary group pay for the blood of our martyrs," the official Irna news agency quoted the president as saying in response to Wednesday's attack.

"The main root of terrorism in the region is America and Zionists, and some oil-producing countries in the region also financially support the terrorists," he added.

Rouhani was speaking at Tehran's Mehrabad Airport before leaving for the Russian resort of Sochi for a summit with his Russian and Turkish counterparts Vladimir Putin and Recep Tayyip Erdogan on the future of war-battered Syria.

The bombing was claimed by the Jaish al-Adl, which is blacklisted as a terrorist group by Iran, the SITE Intelligence Group reported.

The organisation was formed in 2012 as a successor to the extremist group Jundallah, which waged a deadly insurgency for a decade before being severely weakened by the capture and execution of its leader Abdolmalek Rigi by Tehran in 2010.

In comments reported by state television, Iran's Supreme Leader Ayatollah Ali Khamenei said the attack's perpetrators were certainly linked to "the spying agencies of some regional and trans-regional countries."

The European Union condemned the attack, saying "there can be no justification for such an outrageous act of terror," and expressing condolences to the families of the victims.

The bombing, which targeted a busload of Revolutionary Guards in the volatile southeastern province of Sistan-Baluchistan, was one of the deadliest attacks on Iranian security forces in years.

It came just days after Iran held more than a week of celebrations for the 40th anniversary of the Islamic revolution, which overthrew the US-backed shah.

Lebanon's Hezbollah also denounced the attack, saying it was in retaliation for "the Iranian nation's huge turnout in rallies" marking the anniversary.

"The takfiri (extremist) and terrorist gangs behind this horrific suicide attack were nurtured, financed and supported by the US, 'Israel' and their regional allies," Hezbollah said.

The troops killed were aged from 21 to 52 and belonged to the Guards' 14th Imam Hussein Division, the Tasnim news agency reported.

The bomber struck as they were returning from a patrol mission on the border with Pakistan, where Baluchi separatist and militant groups have rear bases, the Guards said in a statement.

Sistan-Baluchistan is home to a large ethnic Baluchi community, who straddle the border.

The Islamic Revolutionary Guards Corps was formed in April 1979 at the order of Ayatollah Khomeini to protect the Islamic revolution from foreign and internal threats.

A special farewell ceremony for those killed is planned for today evening and the funerals will follow tomorrow, Tasnim said.

Rouhani called on Iran's neighbours to assume their "legal responsibilities" and not allow "terrorists" to use their soil to prepare attacks.

"If this continues and they cannot stop the terrorists, it is clear - based on international law - that we have certain rights and will act upon them in due time," he said, without elaborating.

The attack came on the same day as the United States gathered some 60 countries in Poland for a conference on the Middle East and Iran which it hoped would increase pressure on Tehran.

Iran quickly linked the attack to the Warsaw conference.

Dubbing the meeting the "WarsawCircus", Foreign Minister Mohamed Javad Zarif said it was "no coincidence that Iran is hit by terror on the very day" that the talks began in the Polish capital.

"Especially when cohorts of same terrorists cheer it from Warsaw streets & support it with twitter bots? US seems to always make the same wrong choices, but expect different results," Zarif wrote on Twitter.