When Civil Guard lieutenant-colonel Antonio Tejero stormed the parliament building in Madrid, Gabeiras was the key point of contact between King Juan Carlos and the regional army commands, and instructed them to obey the sovereign's orders and defend the constitution. However, his second-in-command, General Alfonso Armada, was desperately trying to subvert his superior's authority by seeking negotiations with the putsch leaders, while aiming to win the army brass around to the idea of a provisional government headed by himself.
After the dramatic broadcast message by the king that effectively brought the coup attempt to a juddering halt, Gabeiras personally dismissed and arrested both Armada and his fellow-plotter, General Jaime Milans del Bosch, who had ordered tanks on to the streets of Spain's third city, Valencia.
Born in the Galician port of Ferrol, Gabeiras was the son of a junior naval officer. As a student at Santiago University, he was noted mainly for his sporting prowess, playing hockey for Spain. In 1935, he enrolled in the Artillery Academy, and as a young cadet took Franco's rebel side in the Spanish civil war. In the second world war, he volunteered in the Blue Division to fight on the Russian front, and as a major was promoted to the Galician regional staff in 1944.
After a steady rise through the ranks, he was made a brigade general in 1973, two years before Franco's death, and in 1977 was appointed general secretary of defence policy to Adolfo Suárez's transitional government. In May 1979, the choice of Gabeiras as chief of general staff shocked several reactionary officers who felt they outranked him. He was preferred by the deputy prime minister, his close friend General Manuel Gutiérrez Mellado, with whom he shared a commitment to placing the armed forces under the control of the civil powers in line with the new constitution. Keen to counter rumblings of discontent among the Francoist old guard, Gabeiras appointed Armada his deputy.
Following the defeat of the challenge to the new democracy, Gabeiras retired as chief of staff in 1984. He held many decorations, including the grand crosses of three military orders. At the age of 85, he re-emerged in public life at the head of an environmentalist campaign against the building of a gas refinery in the Ferrol estuary.
Gabeiras, who died in Madrid and was buried in his native Galicia, is survived by nine of his 11 children.
- José Gabeiras Montero, soldier, born 20 July 1916; died 2 January 2005