A candidate needs a majority (that is supposed to be loyal to him/her during the whole term) to be elected, but the top-voted party can be denied the right to form the government.
This situation, though infrequent in nationwide elections, often happens in local/regional legislatures throughout Spain: the most usual coalition is between the Socialist Party (PSOE) and the United Left (IU).
Elections were repeated after a few weeks and Partido Popular won, then by absolute majority.
Since then, the People's Party victories by absolute majority were repeated in 2007 and 2011's regional elections.
She was replaced by her deputy Ángel Garrido when she resigned after evidence of both a fake master's degree and petty shoplifting came out.