Spain has raised the minimum age for marriage from 14 to 16, having had the lowest marrying age in Europe.
Before the age was raised, boys and girls could marry at the age of 14 with the permission of a judge. It is now level with most European countries.
The change comes only months after the government raised the age of consent from 13 to 16.
The government announced its intention to alter the law in April 2013, but it came into force only on Thursday.
The move was welcomed by officials from Unicef and children's rights groups in Spain.
According to El Pais (in Spanish), only 365 marriages involving under-16s took place in Spain between 2000 and 2014 - with only five in 2014.
In the 1990s, however, there were 2,678 marriages involving at least one under-16 - and 12,867 in the 1980s.
Read more: Spain raises marrying age from 14 to 16 - BBC News