Fifty years after the Spanish civil war erupted, leading to fascist dictatorship that lasted four decades, a new generation of Spaniards will observe the emotional anniversary today by watching a Bourbon monarch entrust the formation of a democratically elected government to a Socialist prime minister.

It is an irony of history that the anniversary will coincide with the protocol meeting between the descendant of King Alfonso XIII, Juan Carlos, and the heir of the Republic's left-wing leaders, Felipe Gonzalez. Both men were born after the outbreak of what Spaniards know as La Guerra. And in their roles as a modern monarch and a pragmatic politician, Juan Carlos and Gonzalez are symbols of a new Spain.

On July 18, 1936, Gen. Francisco Franco led an uprising by military garrisons across the country against the democratically elected leftist government, declaring "Spain had been saved" by the rightist revolt. Three years later, Franco's forces finally crushed the last remnants of the Spanish Republic, culminating a bloody conflict that had repercussions far beyond its borders and portended World War II.

Franco's fascist allies, Hitler's Germany and Mussolini's Italy, soon projected their power across Europe, opposing leftist forces that had sided with the Spanish Republic, ranging from democratic socialists and intellectuals in Western Europe to communist soldiers trained in Stalinist Russia.

More than three-quarters of Spain's 38 million people, born after the mid-1940s, have no physical or emotional memory of the war. For the others, there is little they can relate between the Spain of then and the Spain of now. Events in the past week in Spain illustrate the dramatic contrast.

On July 14, a car bomb placed by Basque separatist terrorists exploded in a Madrid plaza killing nine policemen and injuring at least two dozen more.

Spain took the horror in stride.

In Madrid on Tuesday, in response to a call by the city's mayor, civic protest against terrorism brought traffic to a standstill for three minutes at noon, and office workers stood in silence. It was, as a headline in one local newspaper said, "A Scream of Silence" against fanaticism and violence.

Fifty years ago, on July 12, a lieutenant in Madrid was killed by gunmen belonging to the Spanish fascist party, the Falange. In a reprisal killing, a group of policemen kidnaped the head of the parliament's right-wing opposition, congressman Jose Calvo-Sotelo, shot him in the back of the head while traveling in a police truck through Madrid. His body was dumped by a cemetery.

The conspiracy by Franco and the other generals was already under way well before the dual killings, but Calvo-Sotelo's assassination by security officers proved a more than convenient justification for the military uprising.

Fifty years ago, terrorism on the streets propelled Spaniards toward confrontation. This week, by contrast, showed how the Spaniards today have closed ranks, supporting democracy when terrorism threatens the system.

The most obvious changes in Spain concern the monarchy and the ruling party, Gonzalez's Spanish Socialist Workers Party.

Juan Carlos' grandfather, King Alfonso XIII, lost the throne because he favored the military, tampered with the constitution and alienated progressive politicians. Juan Carlos won the enduring admiration of Spaniards when he decisively backed civilian politicians during a failed, Franco-style, military coup attempt in 1981. He has, both before and after the attempted coup, complied with constitutional restrictions that grant him a mere representative role along the lines of the British monarchy.

Under Gonzalez's leadership, the Socialist party is a far cry from the radical leftist grouping that formed the backbone of the Spanish Republic half a century ago. Prime minister since 1982, Gonzalez has watered down the party's Marxist ideology, steered Spain into the European Community, reaffirmed the nation's NATO membership and actively encouraged private business and foreign investment. Public approval of his moderate policies was expressed by a renewed electoral triumph in last month's polls, where the Socialist party won an absolute majority of seats in the parliament.

A monarchy and the Socialist party coexist now in Spain in a manner that was unthinkable in the 1930s.

The only dark cloud is formed by the hard-line separatist Basque organization ETA. This minority remains unsatisfied by home rule and is pressing an urban guerrilla battle for the total independence of the Basque country.

The battle between church and state that has bedeviled and divided Spain throughout history has largely been overcome.

Fifty years ago, the Roman Catholic hierarchy in Spain enthusiastically backed Franco's revolt and labeled the civil war a "crusade" against communism and atheism. The Republic had been hostile to the church, had expelled members of religious orders and had been tolerant of mobs who ransacked convents.

Today, passions have cooled. Bishops and Socialist officials, many of them churchgoing, are respectful of each other. Spain is not officially a Catholic state, which it was in the Franco years, but it is not militantly secular as it was during the Republic.

Franco placed schooling in the hands of the clergy, banned divorce and penalized abortions. In turn, the socialist government has promoted public education. Divorce and abortions, legalized during the Republic, have been reintroduced.

Yet even today, Spain remains a devoutly Catholic country. Recent surveys suggest that more than 33 percent of the population regularly attends church, ranking Spain just behind Poland and Ireland in terms of religious observance.

The Army was the other great pillar of Francoism. The failed 1981 attempt by hard-line officers to turn the clock back on democracy was a watershed in the long tradition of Spanish military meddling in politics.

What the government is doing now is not unlike what the Republic tried to do with disastrous results. Current defense policy consists of pruning the officer corps and reducing the size of the Army. But while disaffected officers in the 1930s soon rallied to Franco's cause, the present wave of pensioned soldiers seems more resigned to accepting Juan Carlos' insistence that their primary loyalty lies with upholding democratic principles.