<P> The Kingdom of Afghanistan (Pashto: د افغانستان واکمنان ‎, Dǝ Afġānistān wākmanān; Persian: پادشاهي افغانستان ‬, Pādešāhī - ye Afġānistān) was a constitutional monarchy in southern and central Asia established in 1926 as a successor state to the Emirate of Afghanistan . It was proclaimed by its first king, Amanullah Khan, seven years after his accession to the throne . </P> <P> Amanullah Khan was keen on modernizing the country, resulting in conservative forces causing social upheaval on a number of occasions . When he was visiting Europe in 1927, rebellion broke out again . He abdicated in favour of his brother Inayatullah Khan who only ruled for three days before the leader of the tribal rebellion Habibullah Kalakani took power and reinstated the Emirate . </P> <P> After 10 months, Amanullah Khan's Minister of War, Mohammed Nadir, returned from exile in India . His British - supported armies sacked Kabul, forcing Habibullah Kalakani to discuss a truce . Instead, Mohammed Nadir's forces apprehended and subsequently executed Kalakani . Mohammed Nadir reinstated the kingdom, was proclaimed King of Afghanistan in October 1929, and went on to revert the reformist path of the last king, Amanullah Khan . He was succeeded by his son, Mohammed Zahir Shah, whose rule started in 1933 and lasted for 39 years . Mohammed Zahir Shah, the last King of Afghanistan, was eventually overthrown by his own cousin Mohammed Daoud Khan who successfully ended the centuries - old monarchy and established a republican Afghan government . It was under the leadership of Zahir Shah that the Afghan government sought relationships with the outside world, most notably with the Soviet Union, United Kingdom and the United States . </P> <P> On 27 September 1934, during the reign of Zahir Shah, the Kingdom of Afghanistan joined the League of Nations . During World War II, Afghanistan remained neutral and pursued a diplomatic policy of non-alignment . Mohammed Daoud Khan, Prime Minister of Afghanistan at the time, worked hard for development of modern industries, and education in the country . </P>

When did afghanistan ends monarchy and became a republic
find me the text answering this question