Gunmen thought to have been Basque terrorists shot Spain's top field general this morning in an attack apparently calculated to cause maximum tension in conservative military circles still adjusting to a landslide triumph by the Socialist Party in last week's national elections.

Gen. Victor Lago Roman, 63, who commanded the nation's elite armored unit, known as the Brunete Division, was killed in his staff car as he was being driven to his headquarters on the outskirts of Madrid. The general's driver, who survived the attack, said the car had come under automatic weapon fire from close range, apparently fired by a passenger on a motorcycle.

Police charged that the Marxist Basque separatist organization ETA was responsible for the attack. The ammunition was of the type normally used by ETA.

The shooting caused immediate concern in political circles over the impact it might have on Spain's officers. Outgoing Prime Minister Leopoldo Calvo-Sotelo termed the attack "a provocation of the armed forces and of the vast majority of Spaniards who want to live in peace." The prime minister-elect, Socialist leader Felipe Gonzalez, called it "an attempt to assassinate the hopes of a whole people," and the new opposition leader after last Thursday's election, rightist Manuel Fraga, said: "Unless terrorism is effectively eradicated, nothing can be consolidated in Spain."

Hundreds of senior officers hurried to pay their respects to Gen. Lago when his body was transferrred to Army headquarters to lie in state overnight. King Juan Carlos was among the first mourners.

Gen. Lago was highly regarded by his fellow officers as a distinguished field commander. He had joined Gen. Francisco Franco's insurgents at the outbreak of the Spanish Civil War as a 17-year-old and had later served in a volunteer division that fought with the Nazis on the Russian front. For much of his career he was stationed in North Africa with the Spanish Foreign Legion.

Gen. Lago was appointed to the command of the Brunete First Armored Division after a group of right-wing officers tried to overthrow the government in February 1981. The division, 12,000 strong, is the best equipped and trained in the Spanish Army. Its emplacement in a string of camps surrounding Madrid has long concerned those who suspect it could be used to take over the capital in a military coup.

Such concerns were in part borne out during the 1981 coup attempt, when small units of the Brunete Division temporarily took over the national television center and a column from division headquarters joined rebel guardsmen who were holding the parliament hostage. Six of the division's officers, including a colonel, were among those sentenced for their part in the aborted coup.

Gen. Lago's appointment after the coup was interpreted as a move to calm restive officers. While a prestigious field commander with a record of loyalty to Francoism, Gen. Lago was also considered a constitutionalist who had adapted to political changes.

The immediate effect of the attack was to break a period of political quiet that had descended on Spain since the elections. The assassination of Gen. Lago makes the terrorist threat the first priority for the incoming Socialist administration. Gonzalez told a national radio interviewer that his government would use "every possible means a democractic state can count on to get rid of this plague."

Gonzalez noted that "political measures have little effect on ETA" and vowed to increase budgeting for security services.