Agha Muḥammad Khān Qājār (1742–1797) (Persian:

آغا محمد خان قاجار‎)‎‎ was the chief of the Qajar tribe, succeeding his father Mohammad Hassan Khan, who was killed on the orders of Adil Shah. He became the Emperor/Shah of Persia in 1794 and established the Qajar dynasty. He was succeeded by his nephew, Fat′h Ali Shah Qajar.

At the age of six Agha Muhammad was castrated on the orders of Adil Shah to prevent him from becoming a political rival, but this loss did not hinder his career. Despite being a eunuch, he became the chief of his tribe in 1758. In 1762 he was captured by a rival tribe and sent to Shiraz as a prisoner to Karim Khan's court. Agha Muhammad spent the next 16 years as a hostage, until he escaped in 1779. That same year, the death of Shah Karim Khan Zand plunged the country into a series of civil wars and disputes over the succession, with many members of the Zand dynasty acceding to the Peacock Throne in the space of only ten years. Agha Muhammad took the opportunity to launch a rebellion which, in 1794, succeeded in capturing Lotf Ali Khan, the last Zand ruler. Two years later he proclaimed himself Shahanshah (King of Kings).

Home of Agha Muhammad Shah, Shahanshah of Persia in Sari.

Agha Muhammad restored Persia to a unity it had not had since the fall of the Safavid dynasty. He was, however, a man of extreme violence who killed almost all who could threaten his hold on power. In 1795 he ravaged Georgia, a kingdom to the north of Persia, which was formerly part of the Safavid empire. In the same year he also captured Khorasan. Shah Rukh, ruler of Khorasan and grandson of Nadir Shah, was tortured to death because Agha Muhammad thought that he knew of Nadir's legendary treasures.

In 1796 Agha Muhammad moved his capital from Sari in his home province of Mazandaran to Tehran. He was the first Persian ruler to make Tehran--the successor to the great city of Rayy, his capital, although both the Safavids and the Zands had expanded the town and built palaces in there.

Although the Russians took Derbent and briefly occupied Baku during the Persian Expedition of 1796, he successfully expanded Persian influence into the Caucasus, reasserting Iranian sovereignty over its former dependencies in the region. He was, however, a notoriously cruel ruler, who reduced Tbilisi to ashes and massacred its Christian population, as he had done with his Muslim subjects.

Agha Muhammad was assassinated in 1797 in the city of Shusha, the capital of Karabakh khanate, after about 16 years in power. According to Hasan-e Fasa'i's' Farsnama-ye Naseri, during Agha Muhammad's stay in Shusha, one night "a quarrel arose between a Georgian servant named Sadeq and the valet Khodadad-e Esfahani. They raised their voices to such a pitch that the shah became angry and ordered both to be executed. Sadeq Khan-e Shaghaghi, a prominent emir, interceded on their behalf, but was not listened to. The shah, however, ordered their execution to be postponed until Saturday, as this happened to be the evening of Friday (the Islamic Sabbath), and ordered them back to their duties in the royal pavilion, unfettered and unchained, awaiting their execution the next day. From experience, however, they knew that the King would keep to what he had ordered, and, having no hope, they turned to boldness. When the shah was sleeping, they were joined by the valet Abbas-e Mazandarani, who was in the plot with them, and the three invaded the royal pavilion and with dagger and knife murdered the shah."