# List of prime ministers of Spain by length of tenure

This is a list of prime ministers of Spain by time in office. The basis of the list is the inclusive number of days from being sworn in until leaving office.
Of the 102 prime ministers, only four served more than 10 years while sixty-six have served less than a year.
Francisco Franco, who also served as the Head of State until his death, is the only person to have served in the post of prime minister for more than two decades, ruling for a total of 35 years that were preceded by the coup of 1936 and the Spanish Civil War.

## Ordered by tenure

| Rank | Prime Minister | Length served | Terms | Party | Start |
| 1 | Francisco Franco | 35 years, 129 days | 1 | National Movement | 1939 |
| 2 | Práxedes Mateo Sagasta | 13 years, 175 days | 7 | Liberal / Constitutional | 1871 |
| 3 | Felipe González | 13 years, 155 days | 4 | PSOE | 1982 |
| 4 | Antonio Cánovas del Castillo | 11 years, 290 days | 6 | Conservative | 1874 |
| 5 | Ramón María Narváez | 8 years, 240 days | 7 | Moderate | 1844 |
| 6 | José María Aznar | 7 years, 349 days | 2 | PP | 1996 |
| 7 | José Luis Rodríguez Zapatero | 7 years, 248 days | 2 | PSOE | 2004 |
| 8 | Pedro Sánchez | 6 years, 162 days (incumbent) | 3 | PSOE | 2018 |
| 9 | Mariano Rajoy | 6 years, 162 days | 2 | PP | 2011 |
| 10 | Miguel Primo de Rivera | 6 years, 137 days | 1 | Patriotic Union | 1923 |
| 11 | Leopoldo O'Donnell | 5 years, 180 days | 4 | Liberal Union | 1856 |
| 12 | Manuel González Salmón | 5 years, 152 days | 1 | Nonpartisan | 1826 |
| 13 | Antonio Maura | 5 years, 84 days | 5 | Conservative / Maurist | 1903 |
| 14 | Adolfo Suárez | 4 years, 236 days | 2 | UCD / National Movement | 1976 |
| 15 | Eduardo Dato | 3 years, 130 days | 3 | Conservative | 1913 |
| 16 | Baldomero Espartero | 2 years, 293 days | 3 | Progressive | 1837 |
| 17 | José Canalejas | 2 years, 277 days | 1 | Liberal | 1910 |
| 18 | Count of Romanones | 2 years, 243 days | 3 | Liberal | 1912 |
| 19 | Francisco Cea Bermúdez | 2 years, 211 days | 2 | Nonpartisan | 1824 |
| 20 | Carlos Arias Navarro | 2 years, 185 days | 1 | National Movement | 1973 |
| 21 | Francisco Silvela | 2 years, 94 days | 2 | Conservative | 1899 |
| 22 | Manuel Azaña | 2 years, 49 days | 2 | Republican Action / IR | 1931 |
| 23 | Juan Bravo Murillo | 1 year, 335 days | 1 | Moderate | 1851 |
| 24 | Juan Negrín | 1 year, 318 days | 1 | PSOE | 1937 |
| 25 | Leopoldo Calvo-Sotelo | 1 year, 279 days | 1 | UCD | 1981 |
| 26 | Evaristo Pérez de Castro | 1 year, 224 days | 1 | Moderate | 1838 |
| 27 | Francisco Javier de Istúriz | 1 year, 191 days | 3 | Moderate | 1836 |
| 28 | Francisco Serrano | 1 year, 166 days | 4 | Liberal Union / Constitutional | 1868 |
| 29 | Juan Prim | 1 year, 165 days | 2 | Progressive | 1869 |
| 30 | Alejandro Lerroux | 1 year, 150 days | 3 | PRR | 1933 |
| 31 | Francisco Martínez de la Rosa | 1 year, 143 days | 1 | Moderate | 1834 |
| 32 | Manuel García Prieto | 1 year, 135 days | 4 | Liberal Democratic | 1917 |
| 33 | The Count of Heredia-Spínola | 1 year, 98 days | 2 | Nonpartisan | 1823 |
| 34 | The Marquess of Valdeterrazo | 1 year, 51 days | 2 | Progressive | 1840 |
| 35 | Dámaso Berenguer | 1 year, 19 days | 1 | Military | 1930 |
| 36 | José María Calatrava | 1 year, 4 days | 1 | Progressive | 1836 |
| 37 | The Marquess of Miraflores | 353 days | 2 | Moderate | 1846 |
| 38 | Segismundo Moret | 332 days | 3 | Liberal | 1905 |
| 39 | The Marquess of Rodil | 326 days | 1 | Progressive | 1842 |
| 40 | Manuel Ruiz Zorrilla | 317 days | 2 | Radical | 1871 |
| 41 | The Count of San Luis | 301 days | 1 | Moderate | 1853 |
| 42 | Luis González Bravo | 299 days | 2 | Moderate | 1843 |
| 42 | Manuel Allendesalazar | 299 days | 2 | Conservative | 1919 |
| 42 | The Duke of the Infantado | 299 days | 1 | Nonpartisan | 1825 |
| 45 | Raimundo Fernández-Villaverde | 285 days | 2 | Conservative | 1903 |
| 46 | Arsenio Martínez Campos | 277 days | 1 | Conservative | 1879 |
| 47 | José Sánchez Guerra | 274 days | 1 | Conservative | 1922 |
| 48 | Francisco Largo Caballero | 255 days | 1 | PSOE | 1936 |
| 48 | The Count of la Alcudia | 255 days | 1 | Nonpartisan | 1832 |
| 50 | Juan Álvarez Mendizábal | 233 days | 1 | Progressive | 1835 |
| 51 | Marcelo Azcárraga Palmero | 220 days | 3 | Conservative | 1897 |
| 52 | Alejandro Mon | 199 days | 1 | Moderate | 1864 |
| 53 | Luis Carrero Blanco | 195 days | 1 | National Movement | 1973 |
| 54 | Niceto Alcalá-Zamora | 183 days | 1 | DLR | 1931 |
| 55 | Saturnino Calderón Collantes | 175 days | 1 | Liberal Union | 1859 |
| 56 | Eugenio Montero Ríos | 161 days | 1 | Liberal | 1905 |
| 57 | Ricardo Samper | 159 days | 1 | PRR | 1934 |
| 58 | Francisco de Lersundi | 158 days | 1 | Moderate | 1853 |
| 59 | Joaquín Francisco Pacheco | 156 days | 1 | Moderate | 1847 |
| 60 | José López Domínguez | 147 days | 1 | Liberal | 1906 |
| 61 | Joaquín Sánchez de Toca | 145 days | 1 | Conservative | 1919 |
| 62 | Joaquín María López | 130 days | 2 | Progressive | 1843 |
| 63 | Juan de Zavala | 123 days | 1 | Constitutional | 1874 |
| 64 | The Count of Alcoy | 121 days | 1 | Moderate | 1852 |
| 65 | Estanislao Figueras | 119 days | 1 | PRDF | 1873 |
| 66 | Emilio Castelar | 118 days | 1 | PRDF | 1873 |
| 67 | The Count of Toreno | 99 days | 1 | Moderate | 1835 |
| 68 | José Posada Herrera | 97 days | 1 | Dynastic Left | 1883 |
| 69 | The Duke of Frías | 94 days | 1 | Moderate | 1838 |
| 70 | The Marquess of Nervión | 91 days | 1 | Moderate | 1857 |
| 71 | Joaquín Jovellar y Soler | 81 days | 1 | Conservative | 1875 |
| 72 | Joaquín Chapaprieta | 80 days | 1 | Nonpartisan | 1935 |
| 73 | José Malcampo | 77 days | 1 | Constitutional | 1871 |
| 74 | Diego Martínez Barrio | 70 days | 2 | PRR / UR | 1933 |
| 75 | Manuel Portela Valladares | 67 days | 1 | Democratic Centre | 1935 |
| 76 | Santiago Casares Quiroga | 66 days | 1 | IR | 1936 |
| 77 | Álvaro Gómez Becerra | 65 days | 1 | Progressive | 1843 |
| 78 | Eusebio Bardají | 59 days | 1 | Moderate | 1837 |
| 78 | The Duke of Sotomayor | 59 days | 1 | Moderate | 1847 |
| 80 | Juan Bautista Aznar-Cabañas | 55 days | 1 | Military | 1931 |
| 81 | The Marquess of Vega de Armijo | 52 days | 1 | Liberal | 1906 |
| 82 | Nicolás Salmerón | 51 days | 1 | PRDF | 1873 |
| 83 | José Giral | 47 days | 1 | IR | 1936 |
| 84 | Lorenzo Arrazola | 44 days | 1 | Moderate | 1864 |
| 85 | Francisco Pi y Margall | 37 days | 1 | PRDF | 1873 |
| 86 | The Marquess of Irujo | 23 days | 1 | Nonpartisan | 1823 |
| 87 | Florencio García Goyena | 22 days | 1 | Moderate | 1847 |
| 88 | Valentín Ferraz | 16 days | 1 | Progressive | 1840 |
| 89 | Modesto Cortázar | 13 days | 1 | Progressive | 1840 |
| 89 | Víctor Damián Sáez | 13 days | 1 | Nonpartisan | 1823 |
| 91 | Miguel Ricardo de Álava | 11 days | 1 | Progressive | 1835 |
| 91 | The Marquess of Havana | 11 days | 1 | Moderate | 1868 |
| 91 | Torcuato Fernández-Miranda | 11 days | 1 | National Movement | 1973 |
| 94 | Joaquín María Ferrer | 10 days | 1 | Progressive | 1841 |
| 95 | Salustiano de Olózaga | 9 days | 1 | Progressive | 1843 |
| 96 | Juan Bautista Topete | 8 days | 1 | Liberal Union | 1870 |
| 97 | Vicente Sancho | 5 days | 1 | Progressive | 1840 |
| 98 | Augusto Barcía Trelles | 3 days | 1 | IR | 1936 |
| 99 | Fernando de Santiago | 2 days | 1 | National Movement | 1976 |
| 100 | The Count of Clonard | 1 day | 1 | Moderate | 1849 |
| 100 | The Duke of Rivas | 1 day | 1 | Moderate | 1854 |
| 100 | The Marquess of Mendigorría | 1 day | 1 | Moderate | 1854 |