Answer
Mariano Rajoy served as Prime Minister of Spain for two terms, from 2011 to 2018. His first term began following the 2011 general election, in which the People's Party (PP) won a majority of seats in the Congress of Deputies. His second term began after the 2016 general election, in which the PP again won the most seats, but fell short of a majority.