Under Iran's strict Islamic law, divorced women already had automatic custody of girls until they are seven, but were previously only able to keep boys until they were two.
"The Expediency Council granted divorced mothers custody of both girls and boys until the age of seven," Elaheh Kulai, a reformist women deputy, told Reuters on Saturday after it was broadcast on state television.
Iran's conservative-controlled legislative body, the Guardian Council, had twice rejected the change on the grounds that it was against Islamic law, despite its approval by the reformist-led parliament last year.
But parliament's decision was backed by the powerful Expediency Council, the top arbitration body headed by influential former President Akbar Hashemi Rafsanjani.
"It is a positive step forward for defending women's rights," said Kulai. The reform is one of several bids by parliament overcome the conservatives' resistance and improve the lot of Iranian women, who cannot become president or a judge and are entitled to half of the inheritance due to a man.
Judges also often give fathers the custody of their children, regardless of their qualifications as parents.