Spain's embattled prime minister, Mariano Rajoy, already beset by political and economic difficulties, faced severe embarrassment on Thursday after it emerged that he had sent "cut and paste" condolences for the Santiago de Compostela train crash.

After expressing his personal grief and sending his "most heartfelt condolences to the families of the victims", his message went on to send even more regret "for the loss of human life and material damage" inflicted by the earthquake that struck the Chinese city of Gansu on Monday. The blunder was particularly unfortunate since Rajoy is from Galicia, the north-western region in which the crash took place, and was born in Santiago de Compostela, the nearest city to the site of the disaster.

Though the mistake was likely to have been made by an official in the prime minister's office, it was a further blow to a leader already under severe pressure. Next Wednesday, the Spanish prime minister is due to appear before parliament to answer questions about his alleged involvement in the illegal funding of his party, the conservative People's party (PP).

Rajoy on Thursday declared three days of national mourning for the victims of the tragedy whose number climbed to 78, making the crash the most serious rail accident in Spain for almost 70 years. A total of 77 people died as the result of a collision between Seville and Cadiz in 1972, but the biggest number of victims is thought to have resulted from an express train crash in 1944.

Between 500 and 800 people are thought to have died in the disaster which took place at Torre del Bierzo in north central Spain in the early years of General Francisco Franco's dictatorship. The scale of the tragedy was masked by the dictators' censors. The Spanish national rail company said at the time that the death toll was 78.