Demirel was elected chairman at the second grand party convention on 28 November 1964. He facilitated the formation of a caretaker government that ruled between February and October 1965 under the premiership of Suat Hayri Ürgüplü, in which he served as Deputy Prime Minister. Under his leadership, the AP won an unprecedented majority of the votes in the 1965 general election and formed a majority government. Demirel thus became the youngest-ever Prime Minister in Turkish history at the age of 40.