Italian Prime Minister Giovanni Spadolini resigned today, the victim of severe political squabbling within his five-party coalition.

However, in an unxpected move later in the day, Italian President Sandro Pertini rejected the resignation, instructing the 57-year-old Republican prime minister to go before parliament for a full political debate before resigning.

The day's events pointed up the country's current political stalemate and plunged the Italian political world into a confusion that could easily lead to a full-fledged government crisis and to early elections within six months.

But it is also possible that, faced with a parliamentary debate requiring an unequivocal public stance, Spadolini's Christian Democrat and Socialist partners may have second thoughts and allow him to remain in power.

The prime minister's resignation was triggered by a public quarrel that broke out between Treasury Minister Nino Andreatta, a Christian Democrat, and Finance Minister Rina Formica, a Socialist, while Spadolini was in the United States on an official visit.

After returning Monday, Spadolini said he would step down unless the two ministers, who have traded insults in the past, resigned. They did not offer to do so, and after a brief Cabinet meeting this morning Spadolini presented his government's resignation, saying the principle of Cabinet "collegiality" had been unacceptably violated.

It was the second time in three months that Spadolini had turned in his resignation since becoming Italy's first non-Christian Democratic prime minister in 35 years in June 1981.

On Aug. 7 the government resigned following a Socialist defection led by Formica. Spadolini's second Cabinet, identical to the first, won a vote of confidence Sept. 2.