Following the elections to the European Parliament, António Costa was appointed General Secretary of the Socialist Party and candidate for prime minister. The coalition of centre and right-wing parties won the legislative elections but the government fell after a motion, making it one of the governments with the shortest term ever of the portuguese democracy. The alliance of left-wing parties or the so called "Geringonça" has made António Costa Prime Minister of Portugal. After the turmoil, Paulo Portas left the presidency of the CDS party after 16 years of leadership and Marcelo Rebelo de Sousa was elected President of the Republic.