Real Madrid, Barcelona and five other Spanish clubs have been found guilty of breaking European Union rules on receiving financial help from the Spanish authorities.
In three separate investigations, the European Commission has decided the seven clubs gained an unfair advantage over other European Union clubs and must repay the illegal "state aid".
Athletic Bilbao, Osasuna, Barca and Real were found to have benefited from a reduced tax rate for 20 years, and Real also profited from a land transfer with the City of Madrid.
And Elche, Hercules and Valencia must repay significant sums to the state-owned Valencia Institute of Finance for loans they received whilst in financial troubles.
Commissioner Margrethe Vestager said in a European Commission statement: "Using tax payers' money to finance professional football clubs can create unfair competition.
"Professional football is a commercial activity with significant money involved and public money must comply with fair competition rules. The subsidies we investigated in these cases did not."
Real Madrid have been ordered to repay €18.4 million for the land deal while they, Barca, Bilbao and Osasuna face payments of up to €5m after they were listed as non-profit organisations rather than limited liability companies.
Valencia will have to reimburse €20.4m of loans, with Hercules forced to repay €6.1m and Elche €3.7m.
But in another long-running state aid case, the commission, which regulates the EU's single market, has cleared PSV Eindhoven and four other Dutch clubs of receiving unfair support from the public purse.