The Iranian men were convicted of directly aiding Islamic State members who attacked parliament and the Ayatollah Khomeini mausoleum
Eight people convicted over two deadly attacks claimed by the Islamic State group in Tehran last year have been hanged in Iran.
The Iranian men were convicted of directly aiding IS members who undertook the attacks on 7 June 2017, Mizan Online, the Iran judiciary's news agency, said on Saturday.
Four gunmen attacked the capital's parliament complex, which became the target of a lengthy siege.
Armed assailants and suicide bombers also attacked the shrine of revolutionary leader Ayatollah Ruhollah Khomeini in the south of the city.
At least 17 people were killed and dozens injured in the attacks, the only one claimed by the Islamic State group in Iran.
"They [the hanged men] supported them financially and procured arms, while being informed of the aims and the intentions of the terrorist group," the agency said.
Iran's Tasnim news agency said the sentences were carried out on Saturday.
Five assailants died during the assaults, either in the suicide bombings or killed by Iranian security forces.
Legal proceedings continue for others allegedly involved in the attacks, Mizan Online said.
The IS has made Tehran a target after Iran's deep involvement in fighting the group in both Syria and Iraq.