Real Madrid and Atletico Madrid have lost their appeals to FIFA against one-year transfer bans for breaking rules protecting underage players.
FIFA said on Thursday that the Madrid clubs are blocked from registering new players in the next two transfer windows -- winter and summer in 2017.
The FIFA appeals committee dismissed challenges filed by both clubs after transfer embargoes were imposed in January. The bans were later frozen pending the appeals verdicts.
Barcelona were hit with a similar two-term ban for the transfer windows in 2015. As in that case, the clubs can make deals to sign players but cannot register them to play until January 2018.
FIFA said in a statement: "The FIFA Appeal Committee has decided to reject the appeals lodged by Spanish clubs Atletico de Madrid and Real Madrid and to confirm in their entirety the decisions rendered by the FIFA Disciplinary Committee in the respective cases relating to the protection of minors.
"As such, both clubs are to serve a transfer ban that prevents them from registering any players at national and international level for the next two complete and consecutive registration periods for breaching articles 5, 9, 19 and 19bis as well as annexes 2 and 3 of the Regulations on the Status and Transfer of Players (the 'Regulations').
"The transfer ban applies to each club as a whole -- with the exception of the women's, futsal and beach soccer teams -- and does not prevent the release of players.
"Additionally, Atletico de Madrid and Real Madrid have been fined 900,000 and 360,000 Swiss francs respectively, while both clubs have been issued with a reprimand and a warning and given 90 days in which to regularise the situation of all minor players concerned."
Both clubs denied wrongdoing in the matter, which was related to signing teenage players whose registration was accepted by the Spanish Football Federation (RFEF). The players involved featured in games from 2005 to 2014 and reportedly include the four sons of Real manager Zinedine Zidane.
Real Madrid were optimistic about a CAS reversal of FIFA's ruling, saying they "lamented'' Thursday's decision, calling it "unfair."
When FIFA denied Barcelona's appeal, the Catalan club also brought their case to CAS, only to see a final appeal rejected. During their ban, Barca signed players such as Arda Turan and Aleix Vidal, but they did not play until 2016.
FIFA has strict rules on the international transfer of minors because some European clubs in the past have stockpiled young overseas talent, only to release those players a long way from home when they fail to make the grade.
For example, clubs can only sign under-18s from abroad if the player's parents have moved to where the club is based but that move was not triggered by the transfer. Players over 16 are also allowed to move between clubs in the European Union or European Economic Area, or if the player lives less than 100 kilometres from the foreign club he or she is moving to.