The city was founded in the Safavid period about 300 years ago, and its first name was Sablagh. Sablagh is a Turkic word meaning cold spring. Later, in the Qajarid period, the town was called Sablaghi Mukri, meaning Sablagh of the Mookri tribe, due to the residence of the Mookri tribe in the city. This was the name of the town until 1936, when the town was named Mahabad.
Kurds participated in several wars between Safavid dynasty and Ottoman Empire, and gained more predominance. In 17th century AD, Mehabad became the seat of Mukri principality. Many believe Budaq Sultan Mukri, who built Mehabad's Jameh Mosque is the founder of the current town.
Mahabad was the capital of the short-lived Republic of Mahabad, which was declared independent on January 1, 1946 under the leadership of Kurdish nationalistQazi Muhammad. The republic received strong support from the Soviet Union, which occupied Iran during the same era. It included the majority Kurdish-speaking towns of Bukan, Piranshahr, Sardasht and Oshnavieh. After an agreement brokered by the United States, the Soviets agreed to leave Iran, and sovereignty was restored to the Shah in 1947. The Shah ordered an invasion of the Republic of Mahabad shortly afterwards, the leaders of the republic including Qazi Muhammad were arrested and executed. Qazi Muhammad was hanged on 31 March 1947. At the behest of Archibald Roosevelt Jr., who argued that Qazi had been forced to work with the Soviets out of expediency, U.S. ambassador to Iran George V. Allen urged the Shah not to execute Qazi or his brother, only to be reassured: "Are you afraid I'm going to have them shot? If so, you can rest your mind. I am not." Roosevelt later recounted that the order to have the Qazis killed was likely issued "as soon as our ambassador had closed the door behind him," adding with regard to the Shah: "I never was one of his admirers."
On 7 May 2015, the people of the city rioted following the unexplained death on 4 May 2015 of Farinaz Khosravani, a hotel chambermaid. Khosravani fell to her death from a fourth-floor window of the Tara hotel, the hotel where she worked. Anger mounted following reports that Khosravani died attempting to escape an official who was threatening to rape her. The rioters reportedly set fire to the hotel where Khosravani worked.