The Italian parliament today overwhelmingly elected Francesco Cossiga, a Christian Democrat, to succeed 88-year-old Sandro Pertini, a Socialist, as the eighth president of the Italian Republic.

Cossiga, 56, a Sardinian law professor and a former prime minister and ranking Cabinet official, was elected on the first ballot in a rare show of unity by Italy's major political parties, including the opposition Communists.

Cossiga will replace Pertini when the latter's seven-year term expires July 9.

Pertini, who took office in 1978, has undoubtedly been the single most popular Italian president so far.

He is credited with having restored prestige and status to the country's highest office in the bitter aftermath of the resignation of president Giovanni Leone, a Christian Democrat who had been involved in the Lockheed kickback scandal that broke in the mid-70s.

The Italian presidency is in many ways a symbolic post, with real political power in the hands of the prime minister and his Cabinet.

However, the president is the commander of Italy's armed forces and the head of the country's highest single judicial body, the Supreme Council of Magistrates.

In addition, the Italian constitution gives the president the power to name a prime minister, dissolve parliament and call elections when the formation of a viable government proves impossible.

The rapidity of today's election in part reflected widespread respect for Cossiga, for the last two years president of the Italian Senate.

But it indicates primarily a general recognition of the return to political influence here of the Christian Democrats, who two years ago were forced by severe election losses to relinquish the prime ministership to the Socialists, whose leader, Bettino Craxi, still holds that post.

Observers here believe that the multiparty support of Cossiga will further strengthen both the Christian Democrats and the Craxi government, at present one of the longest lasting in recent Italian history.