The first government of Pedro Sánchez was formed on 7 June 2018 following the latter's election as Prime Minister of Spain by the Congress of Deputies on 1 June and his swearing-in on 2 June, as a result of the success of a motion of no confidence against Mariano Rajoy. It succeeded the second Rajoy government and was the Government of Spain from 7 June 2018 to 13 January 2020, a total of days, or .