The Agha of the Janissaries or Janissary Agha (Turkish, Ottoman (1500-1928);: یڭیچری أغاسی; Turkish: Yeniçeri ağası) was a top Ottoman military official and courtier, and the commander of the Janissary corps. Apart from the commander-general of the entire corps, the title of "Agha of the Janissaries" was also borne by the commanders of provincial garrisons of Janissaries.
The Agha was chosen by the Ottoman Sultan, but was not necessarily himself a Janissary. To secure the often uncertain loyalty of the corps, Bayezid II stopped the practice of appointing the (the commander of the regiments) to the post, and instead nominated a member of his own household to the post. These were usually pages who had been recruited, like the Janissaries, via the system, but then had been educated in the palace school, then proven their ability in the inner, private palace service, before being appointed to senior posts in the palace's outer service .
At the same time, Bayezid founded the regiments, initially as the Agha's personal retinue and a means of controlling the corps; eventually these became regular Janissary units, and by the end of the 16th century there were 61 regiments. While the system was employed, the Agha was responsible for checking the new recruited boys on arrival at Istanbul for falsifications or missing persons; his subordinates then examined the boys and allocated them either to the palace service or to the Janissary corps. As the Janissaries' political role increased in the early 17th century, from 1641 on the Aghas were once again appointed from among the Janissary corps.
Contrary to widespread modern perception of the Janissary corps as a monolithic and rigidly organized entity, the individual regiments (s) were not only the primary unit of organization, but also the focus of Janissary corps spirit and loyalty. Except for the commander (or), all officers within each were exclusively drawn from and selected by members of the same regiment based on seniority or merit. Thus, while the Janissary Aghas could and did appoint protégės and trusted aides to commands and thereby had a measure of influence within the individual regiments, their ability to exercise direct control was limited. In addition, the corps lacked a dedicated military staff, with the Agha assisted only by a few civilian officials. This was not a problem while the Janissaries were a small force of about 1,000 troops, but prohibited any effective operational control once the corps mushroomed to 15,000 and more in the course of the 16th and 17th centuries. The usually brief tenures of the Aghas further contributed to their lack of control over the corps.
As a senior member of the court, with the right of direct and private audience with the Sultan, the Agha was a very influential figure in Ottoman politics, and one of the closest advisors of the Sultan. The Agha was not a member of the Imperial Council, but could take part in extraordinary sessions, along with other military commanders. At his residence, the so-called "Agha's Gate" next to the Süleymaniye Mosque, overlooking the Golden Horn, the Agha had his own council, which dealt with all matters pertaining to the Janissaries, but was obliged to inform the Grand Vizier, as the Sultan's unrestricted deputy, before forwarding any petitions to the Sultan.
Along with the Grand Vizier, the Agha of the Janissaries was also responsible for maintaining order in the Ottoman capital, Istanbul. The Agha also had prominent ceremonial and protocollary duties; for example, he accompanied the Sultan on his ceremonial visits to the mosques of the capital for the Friday prayer. When the Agha was absent on campaign, his duties were carried out by his deputy, the, the commander of the 34 regiments, which always remained behind as garrison in the capital. On campaign, the Agha was preceded by a white horse-tail standard, and his attendants had the tails of their robes tucked into their girdles. In the 16th century, the Agha of the Janissaries was one of the fifteen "Aghas of the Stirrup", leading officials from the Sultan's household which according to law qualified for subsequent appointment as provincial governors.