Spain is moving toward two further milestones in its development as a parliamentary democracy and in its integration into modern Europe.
As the milestones come nearer, tension is rising within the country because of fears that the still-powerful military - an anachronistic elite in many ways - may feel this is their last chance to block the progress and modernization that most Spaniards want.
The milestones are:
* The trial, due next month, of the officers of the Army and Civil Guard who attempted last February to overthrow the country's fledgling democracy by temporarily taking hostage almost the entire government within the parliament building in Madrid.
The big question is this: Will justice be stern or will the accused be treated with deferential kid gloves, lest any other course provoke another coup attempt?
* Spain's admission to NATO, likely within a few months since all 15 present members of the alliance have agreed to act favorably on the Spanish government's application to join them.
A considerable section of the military is reluctant to see Spain in NATO because of concern that the resulting contact with the outside world might disrupt their own protected, privileged, and largely isolated way of life.
It is against this background that the surprise changes announced Jan. 15 in the entire command of the Spanish armed forces should be seen.
The incumbent chairman of the chiefs of staff and the chiefs of staff of the Army, Navy, and Air Force have all accepted early retirement - which would have come in June in the normal course of events. The reason given for advancing the change is to avoid switches at the top in the middle of Spain's negotiation for entry into NATO.
In their place have been installed:
* As chairman of the chiefs of staff, Lt. Gen. Alvaro Lacalle Leloup.
* As Army chief of staff, Lt. Gen. Ramon de Ascanio y Togores.
* As Air Force chief of staff, Gen. Emilio Garcia-Conde Cenal.
* As Navy chief of staff, Vice-Admiral Saturnino Suances de la Hidalga.
General Lacalle is known to be close and loyal to King Juan Carlos, who has unequivocally identified himself with the Constitution and parliamentary government. General Ascanio y Togores and Admiral Suances de la Hidalga come from families with an old-fashioned military tradition.
The names of the new team were chosen from lists submitted to the government by the Supreme Council of the Army, Navy, and Air Force.
The ensemble of new appointees would appear to represent a compromise, since it includes a known King's man (and therefore presumably a constitutionalist) and two men who are presumably acceptable to the tradtionalists who have still to be won over to democracy.
Since last February's coup attempt, hard-liners in the military have tried to discredit the King because he chose then to take a stand for democracy. Not only have scurrilous graffiti appeared on walls. Word has also been spread that the King initially supported the coup attempt but subsequently ''ratted'' on the officers involved.
On Jan. 6, King Juan Carlos surprised many by using the military's usual ceremonial and social celebration of the Epiphany to meet head-on the campaign against him. Addressing his senior officers, he denounced ''the calumnies'' directed against him. Recognizing the divisions within the armed forces, he vigorously appealed to them to maintain their discipline and their loyalty to him as commander in chief. Beyond his person, the Constitution (he made clear) was what they were called on to defend.
Implicitly the King was saying that anybody thinking of a coup in the weeks or months ahead is going to have to get rid of him - if the attempt to overthrow democracy is to succeed.
It remains to be seen whether the King's strong words will have any effect on the thinking and atmosphere within the military.
Significantly, General Lacalle took up the theme of discipline in remarks after his swearing-in Jan. 16.
An article on the Spanish military in the Paris newspaper Le Monde earlier this month quoted an Army captain with democratic sympathies as saying:
''In my unit, hard-liners are few: from 5 to 10 percent of the total. Democrats are also a minority. Most NCOs and officers belong to what I would call the prudent group. They don't take sides for or against the Constitution but are chiefly concerned about their future. They have noticed that officers who criticize the (present democratic) regime get promoted. These critics are allowed to spread their ideas and propaganda in barracks, while those who supported democracy in Franco's day are isolated and the victims of discrimination by their colleagues.''
Some observers say that in the last resort the hard-liners constitute a paper tiger. Yet since last February's coup attempt, they have gotten away with outrageous gestures unacceptable in most democracies.
The Civil Guard colonel who led the assault on parliament last February was allowed to write from prison an article for a right-wing publication attacking the government. Lt. Gen. Jaime Milans del Bosch, also in jail awaiting trial for supporting the coup attempt, was awarded a medal. On Dec. 6, 99 officers and NCOs from the Madrid armored division signed a manifesto attacking the press and defending the 32 men due to face court martial next month.
The hard-liners do their best to woo broad popular support by blaming the advent of democracy in Spain for allowing into the country those aspects of current culture so disturbing to much of the rest of the Western industrialized world: drugs, sexual promiscuity, pornography, the weakening of family ties and discipline, and vulgar commercialism.
They also blame democracy for the dilution of the power of central authority in Spain, which has made concessions to the regional autonomists, particularly in Catalonia and the Basque country. The Basque terrorist minority plays straight into their hands.
The military hard-liners have done their utmost to preserve within their quarters the old-fashioned way of life - which many of them believe would be shattered if Spain entered NATO.
Theirs is a pathetic and perhaps obsolete nostalgia - but at least understandable when one recalls that in all its modern history Spain has not had much more than a decade of democratic government.