Mr Rubalcaba is a former interior minister and was the prime ministerial candidate in November’s elections after José Luis Rodríguez Zapatero said he would not seek a third term.
The Socialist administration was swept from power by the Popular party but, at the weekend, Mr Rubalcaba overcame this to defeat Carme Chacón, a former defence minister, by 487 votes to 465 at the party congress in Seville.
But Mr Rubalcaba, who served under both Felipe González and Mr Zapatero, former Socialist prime ministers, emphasised his experience while moving to the left during the internal campaign to become secretary-general. Ms Chacón’s speeches were criticised by some as being too strident.
Socialist leaders – who lost power after adopting harsh austerity measures to cut the budget deficit following three years of crisis – say they are alarmed the new PP government is reversing some of the liberal social measures they regard as their legacy to Spain.
Such measures, often backed by the young but opposed by the Roman Catholic church and its supporters in the PP, include the legalisation of gay marriages and easier conditions for abortions.
“If we go backwards and if, every time the right comes to power, it rethinks all those laws that we did among all of us, to strengthen civil rights, and tries to impose dogmas that belong to some citizens but not to all, the Socialist party will seriously consider the revision of the accord with the Holy See – seriously, seriously,” said Mr Rubalcaba in his speech to delegates.
During the transition to democracy after the death of the dictator Francisco Franco in 1975, Spain reached agreements with the Vatican that entrenched various “temporary” privileges, including tax exemptions and the right to run state-financed schools.
“If they want to go back 30 years, we’ll accept the challenge. We too will go back to 30 years ago and rethink our positions,” Mr Rubalcaba said.
His election as party leader to replace Mr Zapatero continues a Spanish tradition of forbearance for those who lose elections.
Mr Rajoy won in 2011 in spite of two failed attempts in 2004 and 2008 that would probably have seen him ousted as party leader in a less forgiving arena such as the UK’s.