Real Madrid and Atletico Madrid have lost their appeals against the transfer bans on signing players in the next two windows.
The clubs appealed against a decision by Fifa issued after they were found guilty of breaching rules over the transfer of foreign players under 18.
Fifa initially ruled on the case in January, but the appeals meant both clubs could sign players this summer.
Real have already confirmed they will now appeal to the Court of Arbitration for Sport (Cas).
In a statement, the club described the decision as “deeply unjust and contrary to the fundamental principles of disciplinary law”.
Fifa’s investigation concerned players aged under 18 who played in competitions for Atletico between 2007 and 2014, and Real from 2005-2014.
“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,” said a Fifa statement.
“Although Fifa’s approach may appear harsh in an individual case, it is only by enforcing the rules consistently and strictly that the abuses of the past can be avoided and a proper and safe development of minor players secured,” Fifa added.
Atletico were fined 900,000 Swiss francs (£622,000), while Real were told to pay 360,000 (£249,000).
Both clubs, who have denied wrongdoing, have also been issued with a reprimand and a warning and given 90 days in which to regularise the situation of all minor players concerned.
The ban means the clubs will not be able to register new players until 2018.
In April 2014, Barcelona were banned from signing players in two successive windows after they were also found guilty of breaking rules on the transfer of under-18 players.
Fifa bans the transfer of under-18s to different countries unless they meet strict criteria. It introduced the rules to combat the problem of children being victims of exploitation and trafficking.
The governing body said: “While international transfers might be favourable to a young player’s sporting career, they are likely to be contrary to the best interests of the vast majority of players as minors.
“In the past, the trafficking of young players to clubs, mainly in Europe, by unscrupulous persons led to some minors, whose talent may not have met the expectations of the respective clubs, being virtually abandoned on the streets in foreign countries.”
Now, under-18s can only be transferred abroad if:
- the player’s parents move to the country in which the new club is located for non-footballing reasons
- both clubs are in the European Union (EU) or European Economic Area (EEA) and the player is aged between 16 and 18 – even then the buying club must meet more criteria relating to education, training, living conditions and support
- they live within 100km of the club.