Today, Spain is a constitutional monarchy. King Juan Carlos I, the current monarch, is Head of State. The Head of Government (Prime Minister) has the official title of President of the Government.
During the First Spanish Republic (1873–74), Spain had heads of state known as the President of the Executive Power and President of the Provisional Government.
It is only during the Second Spanish Republic (1931–39), however, that the official title of President of Spain (or President of the Republic) existed.
Second Spanish Republic (1931-1939) 
after the abdication of Alfonso XIII on 14 April there was no official head of state, meaning that the Prime Minister, officially known as President of the Government, was in effect the highest office in the land.
Presidents of the Government of the Republic (Prime Minister) (until 31 July 1931 Republic remained provisional) 
On 11 December 1931, Alcalá-Zamora assumed the new role of 'President', the effective head of state. Azaña remained as Prime Minister, head of the government, until 12 September 1933.
Presidents (from 23 July 1936 in Republican Zone only) 
With Franco's victory imminent, a National Council of Defense was established to negotiate a peace settlement with the Nationalists. By this point, Franco was effectively in charge of all Spain.
Presidents of the National Council of Defense (Republican Zone) 
See also