After the republican Prime Minister and President of the Republic resigned on May 30, naval officer José Mendes Cabeçadas Júnior assumed both posts, but after conflicts with other coup leaders, he was forced to resign on June 17. He was replaced by General Gomes da Costa, the leader of the 28 May coup, who assumed the posts of both Prime Minister and President of the Republic. Gomes da Costa was not devoted to the establishment of a permanent military dictatorship, and as a result he was forced out on July 9 in a coup led by the unshakably authoritarian General António Óscar de Fragoso Carmona who assumed both of the highest offices of the state and seized dictatorial powers. Carmona continued as Prime Minister until April 18, 1928 but retained the post of President of the Republic until his death on April 18, 1951.