A strange thing happened on France's election night: the normal roles of victors and vanquished were reversed.

Right-wing politicians, scenting power after a sharp electoral swing away from the left, looked disappointed and tense. Socialist leaders, forced back into opposition after five years in government, seemed relaxed and jubilant.

The revealing facial expressions were testimony to the tactical skills of Socialist President Francois Mitterrand, who has succeeded in transforming an electoral defeat into what amounts to a political victory. By preventing the formation of a solid majority in the new National Assembly, Mitterrand has demonstrated that he is likely to remain the key political figure in France even if he is obliged to share power with his political opponents.

"The constitutional monarch has saved his throne," proclaimed the Paris daily Le Monde, seeking to explain the paradoxical triumph of a president whose party has just been rejected by two out of three French voters.

Elected in May 1981 as the first Socialist president in the 28-year history of the Fifth Republic, Mitterrand is under no obligation to resign until his seven-year term expires in 1988. The right-wing election victory has also made him the first Fifth Republic president unable to impose automatically his will on the National Assembly and Cabinet.

Looking at the election as a straight fight between France's two great political families, the left and the right, the result can only be interpreted as a clear victory for the right. Right-wing candidates collected about 55 percent of the vote against 45 percent for the left, a complete reversal of the balance of electoral forces in 1981.

It is only when one analyzes the detailed returns for the 577-seat National Assembly that the nature of Mitterrand's achievement becomes apparent. By introducing a new system of proportional representation just in time for the legislative elections, the 69-year-old president managed the considerable feat of dividing his right-wing opponents while keeping his own electorate united.

In the 1981 parliamentary election, with voting taking place in single-seat constituencies, the Socialist Party won 58 percent of the seats in the assembly with 37 percent of the popular vote. This time, under new voting procedures, the mainstream right-wing opposition -- composed of the neo-Gaullist Rally for the Republic (RPR) and the Union for a French Democracy (UDF) -- won 48 percent of the seats with 40.8 percent of the popular vote.

In order to achieve their narrow majority in the new assembly, the RPR-UDF are relying on the support of dissident and maverick right-wingers. They have promised that they will not have any formal dealings with the extreme right-wing National Front, which entered the assembly for the first time with nearly 10 percent of the vote and 6 percent of the seats.

The divisions on the right contrast sharply with the situation at the other end of the political spectrum, where the Socialists have succeeded in consolidating their position as the dominant left-wing party. Once the largest political party in France, the Communists ended up with less than 10 percent of the vote, their lowest in over half a century.

The continuing Communist decline stems in part from Mitterrand's controversial decision in 1981 to appoint four Communist ministers to his Socialist-led government. Tainted by the exercise of political power, the Communists now find it more difficult to present themselves as the voice of the disinherited and disgruntled. This role is now played by the National Front.

In 1972, after negotiating a joint electoral platform with the Communists, Mitterrand boasted: "Two men have pushed back communism in France: Gen. Charles de Gaulle, by fighting it, and I, by allying myself with it."

The more responsible Communist voters have deserted in droves to the Socialists, the party they now seem to regard as the most effective barrier to the return of the right to power.

With over 32 percent of the vote, the Socialists have planted themselves solidly in the new National Assembly. Many commentators are predicting that it will be extremely difficult for a new right-wing government to implement all the pledges in the RPR-UDF election platform against the determined opposition of more than 200 Socialist deputies and the president.

The fragmented election result seems tailor-made for Mitterrand, whose political skills were honed under the Fourth Republic, with its byzantine intrigues, shifting alliances and "revolving-door" governments.

By trading the votes of his small centrist party for ministerial posts, Mitterrand managed to acquire considerable influence in many of the 22 governments that succeeded each other between 1946 and 1958.

A member of the French wartime resistance, Mitterrand has the reputation of being at his best at moments of adversity. It took him more than two decades, and long years in the political wilderness, to achieve his dream of becoming president of France -- and he is not about to give up easily. In a television broadcast earlier this month, he declared that he would not allow himself to become "a cut-price president."

As president, Mitterrand retains the power of dissolving the National Assembly, calling a referendum or holding new presidential elections. He has already taken the precaution of placing trusted associates in key administrative positions. A new right-wing government with only a weak hold on the assembly will clearly have great difficulty dislodging these nominees.

The election results were a temporary setback to the ambitions of the two leading right-wing candidates to succeed Mitterrand as president: neo-Gaullist leader Jacques Chirac and former prime minister Raymond Barre.

The narrowness of the right-wing victory has undermined Chirac's strategy of forcing Mitterrand to appoint him prime minister -- and using the post as a stepping stone for a presidential campaign.

Barre, on the other hand, runs the risk of being accused of dividing the opposition. Fiercely opposed to the idea of "cohabitation" between a right-wing government and a left-wing president, as the French call it, he refused to support the joint RPR-UDF lists and ran a solitary campaign. The opinion polls have ranked him as the most popular right-wing politician for the past two years.

In any event, Barre's spoiling tactics do not seem to have helped him. In one of the major upsets of the election, his list of candidates in his Rhone Valley stronghold in southeastern France ended up with fewer seats than did the Socialist list headed by former defense minister Charles Hernu, who was forced to resign in disgrace because of the bungled sabotage of a Greenpeace ship in New Zealand by the French secret services. To make matters worse, Barre's Gaullist rivals did almost as well as his own candidates.