Upon passing the Middle Gate, the visitor enters the Second Courtyard (II. Avlu), or Divan Square (Divan Meydanı), which was a park full of peacocks and gazelles, used as a gathering place for courtiers. This courtyard is considered the outer one (Birûn). Only the Sultan was allowed to ride on the black pebbled walks that lead to the Third Courtyard.
The courtyard was completed probably around 1465 during the reign of Mehmed II, but received its final appearance around 1525 – 1529 during the reign of Süleyman I. This courtyard is surrounded by the former palace hospital, bakery, Janissary quarters, stables, the imperial Harem and Divan to the north and the kitchens to the south. At the end of the courtyard, the Gate of Felicity marks the entrance to the Third Courtyard. The whole area is unified by a continuous marble colonnade, creating an ensemble.
Numerous artifacts from the Roman and Byzantine periods have been found on the palace site during recent excavations. These include sarcophagi, baptismal fonts, parapet slabs and pillars and capitals. They are on display in the Second Courtyard in front of the imperial kitchens. Located underneath the Second Courtyard is a cistern that dates to Byzantine times. It is normally closed to the public.
The Second Courtyard was primarily used by the sultan to dispense justice and hold audiences. This was done here also to impress visitors. Various Austrian, Venetian and French ambassadors have left accounts of what such an audience looked like. The French ambassador Philippe du Fresne-Canaye led an embassy in 1573 to the sultan: At the right hand was seated the Agha of Janissaries, very near the gate, and next to him some of the highest grandees of the court. The Ambassador saluted them with his head and they got up from their seats and bowed to him. And at a given moment all the Janissaries and other soldiers who had been standing upright and without weapons along the wall of that court did the same, in such a way that seeing so many turbans incline together was like observing a fast field of ripe corn moving gently under the light puff of Zephyr. We looked with great pleasure and even greater admiration at this frightful number of Janissaries and other soldiers standing all along the walls of this court, with hands joined in front in the manner of monks, in such silence that it seemed we were not looking at men but statues. And they remained immobile in that way more than seven hours, without talking or moving. Certainly it is most impossible to comprehend this discipline and this obedience when one has not seen it.
A strict protocol that governed the functioning and workings of the Second Courtyard was to ensure discipline and respect, as well as lend an air of majesty to the court.