In 1926, he was involved in the military and political movement that resulted in the 28 May 1926 coup d'état that inaugurated a new conservative, authoritarian regime. Following the military coup, Gomes da Costa deposed moderate José Mendes Cabeçadas, who had received executive and presidential power from the removed Prime Minister António Maria da Silva and President Bernardino Machado, briefly holding the headship of government and of state in the summer of that year, until he was himself removed by another coup, to be replaced by Óscar Carmona.