A leading Socialist Party rival to French President Francois Mitterrand resigned from the Cabinet today after publicly opposing the government's plans to change the country's electoral system.

The surprise departure of Michel Rocard, 54, as minister of agriculture was attacked as an act of betrayal by other senior Socialist Party leaders. It comes at a difficult moment for Mitterrand's left-wing administration, which is under heavy attack from the right because of its electoral reform plans.

French commentators today predicted that the switch to proportional representation in next year's legislative elections from the existing system of majority voting would alter significantly the political system introduced in 1958 by Charles de Gaulle.

"Death of a Republic" was the banner headline in the popular right-wing daily, Quotidien de Paris. Liberation and Le Matin, two left-leaning newspapers that generally support the Socialist Party, came out with the more nuanced verdict: "Fifth Republic -- Model II."

Rocard, who announced his resignation at 2:27 a.m. after a late night telephone conversation with Mitterrand, was not available for comment today. But he already has made clear his belief that the introduction of proportional representation could result in a return to a succession of unstable coalition governments such as France knew under the Fourth Republic between the end of World War II and de Gaulle's return to power in 1958.

Political analysts, however, suggested that several other factors besides the electoral reform controversy could have influenced Rocard's decision. He is a probable presidential candidate in 1988 and the leader of the moderate social democratic wing of the Socialist Party and has evidently judged that the time is right to present himself as a clear political alternative to Mitterrand and Prime Minister Laurent Fabius.

The latest opinion polls suggested that Fabius, 38, has succeeded in overtaking Rocard as France's most popular politician. Both men have sought to project a modern, pragmatic image in sharp contrast to the left-wing idealism of many other Socialist Party leaders.

Rocard's resignation was attacked as "a stab in the back" by a Socialist Party spokeswoman, Veronique Neiertz, but praised as "an act of courage" by leaders of the right-wing opposition. The government announced that he would be replaced as agriculture minister by Henri Nallet, Mitterrand's principal adviser on agricultural problems.

The latest Cabinet shake-up further narrows Mitterrand's political base, which was reduced last summer when the Communist Party withdrew from the government and announced that it was abandoning its strategy of forming a union of the left with the Socialists. It could in theory also deprive the Socialists of their automatic majority in the 491-seat National Assembly.

But Rocard's faction of 47 deputies is split between proponents of the outgoing winner-take-all voting system and proportional representation. Rocard was criticized today by one of his closest supporters, former economic cooperation minister Jean-Pierre Cot, for choosing "this subject and this precise moment" to resign.

Relations between Rocard and Mitterrand have been stormy ever since the 1960s, when both politicians emerged as the leading left-wing rivals to de Gaulle. Rocard first ran for president in 1969 after taking over the small Unified Socialist Party but he got only 3.6 percent of the vote.

The two clashed again in 1978, when Rocard, then a member of the Socialist leadership, attacked the party's "archaic" direction. Rocard announced his candidacy for president in 1980 but later withdrew in favor of Mitterrand.

After the Socialist election victory in 1981, Rocard was appointed to the relatively junior post of planning minister, becoming agriculture minister after a government reshuffle in March 1983.

Rocard's departure has made it even more difficult for political analysts here to predict exactly how the French political system will be changed by the introduction of proportional representation, which is expected to be approved easily by the Socialist-controlled National Assembly.

Several commentators predicted that the new system would help to free the Socialist Party from the need to ally itself with the Communist Party by opening up new possibilities of center-left coalitions and breaking the ideologically polarized mold of French politics.

Computer projections based on last month's local election patterns indicate that the mainstream right-wing parties would win an overwhelming majority in the National Assembly if the present system of majority voting were maintained. One poll gave the coalition of neo-Gaullists and former president Valery Giscard d'Estaing's Union for a French Democracy a total of 333 out of 474 seats, compared with only 128 for the Socialists and 13 for the Communists.

The same poll, conducted for the weekly magazine Le Point, showed that a proportional system similar to that announced by Mitterrand would give the coalition 264 seats, the Socialists 158, the Communists 31, the extreme right-wing National Front 18, and the Ecologists 3.

Analysts cautioned, however, that these projections do not take into account the government's decision to increase the number of seats in the assembly by 86 or the new distribution of seats.