Albert Gea / Reuters
FIFA's Disciplinary Committee found Barcelona and the Spanish Football Association (RFEF) guilty of making or allowing illegal deals.
As well as the transfer ban, which will effectively last 14 months, FIFA fined Barcelona 450,000 Swiss francs, (369,000 euros, $509,000).
The Spanish champions were given 90 days to regularise the situation of all 10 minor players concerned.
A Barcelona source said they were analysing the situation and would make a statement at the approporaite time, but the club are expected to appeal against the shock sanction.
Any appeal would have to be lodged with FIFA's Appeal Committee within three days and the club could take the case to the Court of Arbritration for Sport as a final measure.
The ban is a new blow to the image of Europe's most successful club of the 21st Century following alleged tax evasion in its signing of star Brazilian Neymar.
If upheld, the ban would have serious consequences for Barcelona, especially with veterans Carles Puyol and injured goalkeeper Victor Valdes set to leave in June.
The Catalans were expected to complete the signing of German international goalkeeper Andre Ter-Stegen to replace Valdes.
Croatian international Alen Halilovic's move to the club, officially announced last week, could also now be put on hold.
In February last year FIFA banned six Barcelona youth team players from competitive games, Lee Seung-Woo, Paik Seung-Ho and Jang Gyeol-Hee from South Korea, Patrice Sousia of Cameroon, France's Theo Chendri and Bobby Adekanye, a Nigerian-Dutch teenager.
In 2010, FIFA imposed a similar transfer window ban against Chelsea over the signing of French youngster Gael Kakuta. It was overturned after Chelsea reached an agreement with the player's former club Lens.
"The Disciplinary Committee regarded the infringements as serious and decided to sanction the club with a transfer ban at both national and international level for two complete and consecutive transfer periods," a FIFA statement announced.
The dramatic sanction follows an investigation last year by FIFA, whose rules state that a player has to be 18 to be transferred, unless the player falls into one of three specific cases.
FIFA fined the Spanish federation 500,000 Swiss francs for their role in the under-age player affair and gave them one year to modify rules concerning international transfers of minors.
Both Barcelona and the Spanish federation were found guilty of illegal deals involving "the international transfer and first registration of non-Spanish minors with the club".
The dates of the Spanish transfer windows covered by Wednesday's punishment are July 1-August 31 for the pre-season window and January 1-February 1 for the mid-season window.
The world body looked at cases involving players signed by Barcelona between 2009 and 2013.
International rules ban any transfer of a minor unless the player's parents have moved country; the move takes place within the European Union if a player is aged between 16 and 18; or the player's home is less than 50 kilometers (31 miles) from the national border being crossed.
Barcelona were caught out by FIFA's web-based Transfer Matching System which became mandatory for all international transfers of professional male footballers in October 2010.
FIFA said it took the protection of minors in football "very seriously", and warned that "young football players are vulnerable to exploitation and abuse in a foreign country without the proper controls."
The sanction came less than 24 hours after Barcelona's 1-1 draw with Atletico Madrid in the Champions League quarter-final first leg.
Barca's goal was scored by Neymar, whose scandal-mired transfer triggered the downfall of Barca president Sandro Rosell and saw the club indicted for an alleged tax fraud of 13.5 million euros.
Barca have protested their innocence throughout the Neymar inquiry by a Spanish judge.