Iran's foreign minister rejected Donald Trump's condolences for deadly attacks in Tehran, calling the US president's words repugnant.

Mr Trump had said he prayed for the victims of yesterday's attacks that were claimed by the so-called Islamic State, but added that "states that sponsor terrorism risk falling victim to the evil they promote."

Mohammad Javad Zarif wrote on his Twitter account:"Repugnant White House statement ... Iranian people reject such US claims of friendship."

Repugnant WH statement & Senate sanctions as Iranians counter terror backed by US clients.Iranian people reject such US claims of friendship — Javad Zarif (@JZarif) June 8, 2017

Thirteen people were killed and more than 40 wounded in yesterday's attacks on Tehran's parliament complex and the shrine of revolutionary leader Ayatollah Ruhollah Khomeini, the first claimed by IS in Iran.

Mr Trump has long accused Iran of backing terrorism and has threatened to tear up a 2015 nuclear deal between Tehran and major powers.

Even as Washington expressed its condolences, the US Senate advanced legislation that would impose new sanctions on Iran, partly for what the bill described as the Iranian regime's "support for acts of international terrorism".

Iranian security officials counter that it is their regional rival Saudi Arabia - a close US ally - that is responsible for funding and spreading the extremism that underpins IS.

Iran's Revolutionary Guards accused Riyadh and Washington of being "involved" in yesterday's attacks and vowed revenge.

Mr Trump's comments also brought criticism from Iranians on social media, who recalled their government's offers of support and the candlelight vigils held in Iran after the attacks of 11 September 2001.

The five men who carried out the attacks in Tehran were Iranians who joined the Islamic State group in Iraq and Syria before returning last summer, the intelligence ministry.

"The five known terrorists... after joining the Daesh (IS) terrorist group, left the country and participated in crimes carried out by this terrorist group in Mosul and Raqa," the ministry said in a statement.

The statement indicates only five people carried out the twin attacks, rather than six originally reported.