Agă was a military function in Wallachia and Moldavia. The name is of Turkish origin, the title of Ağa of Agha (meaning chief or master) being used in the Ottoman Empire as a title placed after the name of certain military functionaries. At the same time, in the Ottoman Empire, some court functionaries were entitled to the Ağa title.
The title was first used in Wallachia in 1620, for the commander of the infantry, (especially for the armed forces guarding the capital Bucharest, who previously had been called căpitan de vânători or căpitan de dorobanţi. The name was later used also in Moldavia for the commander of the infantry guarding the capital Iaşi.
Initially the agă was a high ranking boyar. Later the title was extended mainly to the commander of the police force of various cities.