A court has sentenced the young men to 30 and 40 lashes each, reports the BBC, citing an official Iranian newspaper.
The girl gets 100 lashes because the court found she falsely claimed she was raped and kidnapped, charges that could have resulted in the men's execution.
Extramarital sex is illegal in Iran and can in some cases be punished by death.
"I trusted one of these young men, whom I got to know by phone, and went to his place," the newspaper quotes the girl as saying. "But because he betrayed me, I filed the case against him and his friend out of revenge."
Women's rights are a sore point in Iran.
Under the strict form of Islamic law applied in Iran, men can keep up to four wives at the same time, a right not granted to women. Also, a woman needs her husband's permission to work or travel abroad, while a man's court testimony is considered twice as important as a woman's.
There are no official statistics available on polygamy in Iran, but it is prevalent in many small cities and rural regions in Iran.