For the 2004 Spanish general election, Rubalcaba was responsible for the electoral strategy of the PSOE. Some political analysts attribute him a decisive role in the socialist victory. After the constitution of the Cortes Generales, Pérez Rubalcaba was appointed Leader of the Socialist Group in the Congress of Deputies. On 11 April 2006 he replaced José Antonio Alonso as head of the Ministry of the Interior. It was in this ministry where he gained popularity within his party, thanks, among other measures, to the change of direction in the fight against terrorism that led to the end of the violence of ETA. However, several media and political parties accused Rubalcaba of being involved in the Faisán case, about an extortion network of ETA, a fact that has not been verified. After the socialist victory in the general elections of 2008, Pérez Rubalcaba was renewed in the ministerial portfolio, occupying again the position of Minister of the Interior to exercise during the IX Legislature. Between 20 May and 30 June 2008 he assumed the duties of Minister of Defense temporarily during the maternity leave of the head of the department, Carme Chacón, combining these functions with his work in front of Interior. He replaced on 21 October 2010 María Teresa Fernández de la Vega as First Deputy Prime Minister and Spokesperson of the Government, accumulating these charges to the head of the Interior portfolio. On 10 January 2011, ETA declared that their September 2010 ceasefire would be permanent and verifiable by international observers. On 20 October 2011, the Basque terrorist group, after 43 years of activity and more than 800 deaths in Spain, announced its definitive cessation of violence. As Minister he also had to face the high accident rate on Spanish roads. His mandate was the most successful in history in reducing the number of fatalities and became a benchmark at European level.
Premiership candidate
As it became assumed that President Zapatero was not going to seek reelection he became favorite to succeed him with Carme Chacón as his only rival in the primaries. Nevertheless, in May 2011, Chacón announced that she was withdrawing from the race and in June the Party announced that no other candidate had filed and Rubalcaba became the PSOE's candidate to the premiership for the 2011 general elections. On 8 July 2011, he resigned from his duties in the government in order to focus on the general election campaign, which he lost getting the worst results in PSOE's history. He filed to succeed José Luis Rodríguez Zapatero as PSOE's General Secretary and won the vote, held in 6 February 2012. He received 487 votes against 465 for Carme Chacón.
Stepping down and later life
Due to the bad results of the party in the 2014 European Parliament election, on 26 May 2014 he resigned of the office. After a leadership election, Rubalcaba was succeeded by the newly elected Secretary General Pedro Sánchez on 13 July 2014. In September 2016 it was announced that Pérez Rubalcaba rejoined his position as Chemistry professor at the Complutense University of Madrid and, in addition, he joined the editorial board of the Spanish newspaper El País, of which he was part until July 2018. Amid the 2019 Madrid City Council election, on 26 December 2018 he rejected the proposal of Pedro Sánchez to be the PSOE candidate for mayor of Madrid.
Death
Rubalcaba was admitted to the Puerta de Hierro Hospital, in Majadahonda, on 8 May 2019, after suffering a severe stroke after teaching in the university. He died two days later aged 67 and PSOE cancelled all the acts of the first day of the campaign for local elections. He had a funeral with state honors at the Congress of Deputies.