Basque separatist governor of Madrid today in an apparent attempt to provoke the armed forces into reversing Spain's transition to democracy.

Maj. Gen. Constantino Ortin, 63, was gunned down by automatic weapon fire outside his apartment at lunch time.

ETA, the guerrilla underground struggling for the independence of Spain's four Basque provinces, took responsibility for the slaying in telephone calls to Spanish news agencies.

ETA has claimed 42 murders of military officers, poiice and others in the past three months.

Political violence claimed 99 lives in Spain last year. Ortin, a 1936-39 civil war veteran who commanded the military garrison in the capital and in Madrid province, was one of the highestranking officers to be assassinated so far. His death caused great consternation among government and political leaders.

Spain is preparing for spring parliamentary and municipal elections under its first democratic constitution in four decades. It went into effect last week.

Politicians expressed the fear that continued violence, particularly against military officers, could disrupt the elections or affect the results. Yesterday an army major serving as an aide to the military governor of the Basque province of Guipuzcua was slain in San Sebastian. A brigadier general and an aide were machine-gunned to death in Madrid in July.

ETA, which has rejected the nascent democracy, also announced today that it killed the major in San Sebastian yesterday.

The consecutive murders led Enrique Mugica, a Socialist and a Basque who was chairman of the military committee in the recently dissolved parliament, to warn: "The assassination of General Ortin, along with the killing of the major yesterday, marks the highest point yet in the escalation directed at destroying Spain's emerging democratic institutions."

The Socialist leader, who has developed close relations with the largely rightist military establishment, asked that the armed forces and the people remain united in the face of unabated "provocations."

Similar statements were made by other democratic politicians. A rightist party, however, charged that the general's slaying was another indication "of the deterioration of law and order and of individual security in Spain, as well as the absolute inability of the government to face up to it."

Spain's military has been divided on how to deal with ETA. Some highranking officers have suggested that the only solution is military occupation of the region under martial law. But Premier Adolfo Suarex has refused to take any drastic measure in the difficult transition period from the dictatorship of Francisco Franco to a democratic monarchy under King Juan Carlos.

The government, instead, has assigned special anti-terrorist secret police to the region. The special units' major objective has been to break up ETA's secret organization. In recent weeks, police have announced the arrest of a number of secret ETA members said to have helped organize killings, kidnapings, bank robberies and the bombing of the construction site of a nuclear power plant.