Sukarno was the leader of his country's struggle for independence from the Netherlands and was Indonesia's first president, in office from 1945 to 1967. He was a prominent leader of Indonesia's nationalist movement during the Dutch colonial period, and spent over a decade under Dutch detention until released by the invading Japanese forces. Sukarno and his fellow nationalists collaborated to garner support for the Japanese war effort from the population, in exchange for Japanese aid in spreading nationalist ideas. Upon Japanese surrender, Sukarno and Mohammad Hatta declared Indonesian independence on 17 August 1945, and Sukarno was appointed as first president. He led Indonesians in resisting Dutch re-colonization efforts via diplomatic and military means until the Dutch acknowledgment of Indonesian independence in 1949.After a chaotic period of parliamentary democracy, Sukarno established an autocratic system called "Guided Democracy" in 1957 that successfully ended the instability and rebellions which were threatening the survival of the diverse and fractious country. The early 1960s saw Sukarno veering Indonesia to the left by providing support and protection to the Indonesian Communist Party (PKI) at the expense of the military and Islamists. He also embarked on a series of aggressive foreign policies under the rubric of anti-imperialism, with aid from the Soviet Union and China. The 30 September Movement led to the destruction of PKI and his replacement by one of his generals, Suharto, and he remained under house arrest until his death.