Last updated on .From the section European Football

Real Madrid and Atletico Madrid have lost appeals against Fifa bans on signing players in the next two transfer windows.

The clubs contested a decision by world football's governing body to punish them for 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.

The Spanish sides will now appeal to the Court of Arbitration for Sport.

In a statement, 11-time European champions Real described the decision as "deeply unjust and contrary to the fundamental principles of disciplinary law".

Atletico said they had already hired "a team of international experts to defend the case and protect the rights" of the club.

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.

It added both clubs had been given 90 days in which to "regularise the situation of all minor players concerned".

Atletico were fined 900,000 Swiss francs (£622,000), while Real were told to pay 360,000 (£249,000).

Spain international Alvaro Morata rejoined Real Madrid this summer

The next two transfer windows are in January 2017 and the summer of the same year. It means the clubs will not be able to register new players until 2018.

This summer, Real Madrid's new arrivals included Brazil midfielder Lucas Silva from Marseille, and striker Alvaro Morata returning to the club from Juventus for 30m euros (£25m).

Atletico signed France striker Kevin Gameiro, Croatia defender Sime Vrsaljko, Italy winger Alessio Cerci and Argentina midfielder Nicolas Gaitan.

In April 2014, Barcelona were banned from signing players in two successive windows after they also breached rules on the transfer of under-18 players.

Their ban, which ended in January 2016, did not stop the La Liga side from signing players.

They bought Arda Turan and Aleix Vidal in 2015, though both players were prevented from playing until the January 2016 window opened.

'Children abandoned on the streets in foreign countries'

Fifa bans the transfer of under-18s to different countries unless they meet strict criteria. It brought in the rules to help protect children from 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.

Last year Fifa dealt with more than 2,700 applications for the transfer of a child to a club in another country. Almost 400 of those applications were rejected.