The minimum age for marriage in exceptional cases, which require the consent of a judge, has been raised from 14 to 16, though the general rule is still that people need to be 18 to marry.
The former threshold of 14 years was among the lowest in Europe.
Spain's conservative government also raised the age of consent from 13 to 16, a measure it said was necessary to combat paedophilia, while decriminalising sexual relations between teens of the same age.
The law aims to stop "abuses, those relationships that are not between one equal and another," Salome Adroher, family and child services director at the health ministry, said.In Spain, marriages between minors are increasingly rare.
In 2014, just one marriage involving a minor under the age of 15 took place, according to the National Institute of Statistics.
The gypsy community, of which early marriage was once a hallmark, has also largely abandoned the practice, said Manuel Gonzalez of the Roma Association of Madrid.
"Some 50 or 60 years ago... 14-year-olds were considered men. They worked to support their households, they didn't have a childhood," he told AFP.
"In the past 20 or 30 years, things have changed a lot," he said.
Today the average marriage age in the community ranges from 16 to 20 for women and from 18 to 22 for men, according to the Foundation of Spanish Gypsies.