The court found that the country’s practice of automatically registering a child under the father’s surname was “patriarchal” and “discriminatory”.
Judges have ordered Italy to change the law, which dates back to the Roman era.
The case began in 1999, when a couple were refused permission to give their daughter the mother’s maiden name.
Alessandra Cusan and Luigi Fazzo appealed against the decision, arguing that there was no provision in Italian law which prevented Maddalena from bearing the maternal surname.
But the court dismissed the appeal on the basis that the rule “corresponded to a principle rooted in social consciousness and in Italian history”.
The couple won a minor victory in 2012, when authorities in the city of Milan allowed Maddalena to be called Fazzo Cusan.
But last year the couple decided to took the case to the ECHR in the French city of Strasbourg.
On Tuesday, the ECHR ruled that Italy’s law was incompatible with the principle of gender equality enshrined in Italy’s modern constitution.
The tribunal called the practice “excessively rigid”.
“The child’s father and mother were treated differently… in spite of an agreement between the spouses,” the ECHR said in its ruling.
“The tradition conferring the father’s surname to all the members of a family could not justify discrimination against women.”
Rome will have to change its legislation to comply with the ruling, unless it lodges an appeal with a higher chamber of the European court within three months.