The leadership of the Italian Socialist Party today unanimously rejected a bid by President Francesco Cossiga to have Giulio Andreotti, a Christian Democrat and a prime minister five times previously, try to form a new coalition government.

The Socialist action, which came even before Andreotti had begun his formal negotiations with Italian political leaders, deepened the political crisis in the wake of the resignation of Socialist prime minister Bettino Craxi two weeks ago.

In a note issued by the Socialist leadership after a one-hour meeting this morning, the party termed the appointment of 67-year-old Andreotti, who was Craxi's foreign minister, "an expression of an initiative for a break and serious conflict with the Socialists." As such, the note said, the party could only reject it, even if it bore Andreotti himself no rancor.

Political analysts said a continuing failure of the Socialists and Christian Democrats to agree on a formula for a new government would spell the end of the five-party coalition that Craxi led for almost three years to give Italy its most stable government since World War II. Aside from the Christian Democrats and Socialists, the coalition comprises the small Republican, Liberal and Social Democratic parties.

A collapse of the coalition, these analysts said, almost certainly would mean an early dissolution of the Parliament, which normally would serve until 1988, and new national elections this fall or next spring.

The heart of the crisis is a deep personal rivalry and animosity between Craxi and Christian Democratic leader Ciriaco de Mita, who as the head of Italy's largest political party has decided that it is time for a Christian Democrat to lead the government rather than a Socialist.

The Christian Democrats headed virtually every one of Italy's more than four dozen postwar governments until 1981 when they were forced to cede it first to a Republican, then to Craxi, after a series of scandals.

Craxi, 52, a strong-willed politician, has argued that the stability and success of his government over the past years does not justify its being brought down purely because the Christian Democrats hunger for his job.

Cossiga at first sought to find a formula for reappointing Craxi, but the Christian Democrats made acceptance of a new Craxi prime mininistership dependent on it being limited in duration. Alternatively, if allowed to continue until the end of the legislature in 1988, party leaders said they would support it only if Craxi vowed to support them during the five-year mandate of the next legislature.

Craxi termed those conditions unacceptable and provocative, thus setting up the deadlock that Cossiga sought to unblock with Andreotti's appointment yesterday.

Andreotti is to begin his formal consultations with party leaders Monday. He is expected to report back to the president at midweek.

According to political analysts here, the president then will have the option of asking Andreotti to try again, accepting that the only hope for him would be to head an interim minority government until new elections this fall or, at the latest, in spring of 1987.

Another option would be for the president to turn to one of the three smaller parties in the coalition for an interim prime minister whose responsibilities would also most likely be to arrange for new elections.

Virtually every party here insists that no one wants new elections.