Third Court / Enderun Courtyard

 Enderûn (meaning "inner most") was the “selâmlık” portion reserved for men, of the private compartment of the palace. It was also called the “Harem-i Hümâyûn” (Imperial Seraglio) together with the Harem where the Sultan lived with his family. The Enderûn Courtyard which took form during the reign of Fatih Sultan Mehmet - the Conqueror - (1451-1481), consists of the patio where the Sultan’s pavilions are located, the marble terrace called Sofa-i Hümayun (Imperial Hall) harbouring the Sultan’s mansionsand the flower garden. That courtyard contains as well the dwellings of the Enderûn School, destined to the education of the youngsters recruited via Devshirme (Ottoman Turkish: Devşirme) - a system of recruitment of youngsters of foreign background for serving the Ottoman Empire.
The Enderûn Institution, inspired from the state organization schemes of the Great Seljuk Empire and Seljuk Sultanate of Rum, functioned for centuries as the principal Ottoman establishment devoted to the education and training of the future members of the high-level state and military bureaucracy, where also the artistic skills of students in various fields were developed. In the framework of the above-mentioned Devshirme system which existed from the first half of the 15th Century up until the end of the 17th Century, the Ottoman Sultans created a class of civil servants loyal to them, educated within the principles of the Islamic religion and Turkish culture. A group of the thus recruited pages were educated at the Palace as such and others were trained in the army. They were eventually assigned to high ranking positions in the state apparatus following their schooling. From the 18th Century onwards, these high posts were occupied by native Turks.
During the initial phase, the youngsters were confided as pupils to a Turkish family where they learned Turkish and were brought up within the traditions and customs of Turkish society. Following that phase, they were sent to preparatory schools. The most gifted among them were then admitted into the classes of the Enderûn School. There, the interns were studying in successive wards beginning from the Big Room and Small Room, continuing respectively through the Dormitory of the Expeditionary Force (Seferli Koğuşu), the Pantry, Treasury and Privy Chamber wards. The students who were fulfilling symbolic tasks relevant to the function of each particular ward, had then the possibility to climb the ladder of public offices all the way up to the post of Grand Vizier (Greatest Minister holder of the Sultan’s imperial seal). 
The Enderûn Courtyard is so structured as to highlight the Sultan’s buildings, like in other venues of the Palace. Dwellings used by the Sultan such as the Conqueror’s Pavilion, also called the Conqueror's Kiosk (Fatih Köşkü), the Privy Chamber, and the Pool Pavilion were situated in the centre and inner corners of the courtyard whereas the wards used by the students of the Enderûn School were located at its outer edges. These wards opening up to the courtyard through their porches had an interior layout consisting of a small hall surrounded by the dormitories, the glass room and the baths.  The Enderûn wards were lined up in a hierarchical order arranged according to the level of training classes. The Big and Small Room wards located on each side of the Gate of Felicity (Bâb-üs Saade) and the Ward of the Expeditionary Force (Seferli Koğuşu) established in the 17th Century after demolishing the Sultan Selim II Bath would constitute the lower rungs of the School of Enderûn. While others are the Pantry, the Treasury and the Privy Chamber wards. The Privy Chamber Ward is known to be intertwined with the actual Privy Chamber. Also in this direction, there is the Mosque of the Ağas (Ağalar Camii). In the middle of the Enderûn courtyard was the Pool Pavilion which was demolished in the 18th Century and replaced by the Enderûn Library (Ahmet III Library).
The establishment of a new army in 1826 after the abolition of the Janissary Corps was also the occasion for the creation of a new education system. After this date, the Enderûn School and Institution began to lose of its importance.