A terrorist commando unit assassinated one of Italy's top prosecutors in a street ambush in Milan today, increasing tension and sparking unrest in the judiciary in the final days of Premier Giulio Andreotti's government.

Emilio Alessandrini, a 37-year-old assistant district attorney who had been investigating both neofascist and left-wing terrorists, was cut down in a hail of bullets while his car waited at a traffic signal. The five-member assassination squad fired a smoke bomb and escaped.

A leftist revolutionary group, Prima Linea, or Front Line, claimed responsibility for the killing. Alessandrini was the sixth law official to be assassinated in the last two years.

The assault came hours before Andreotti addressed parliament, defending his 10-month-old government that took office on the day former premier Aldo Moro was abducted by the leftist Red Brigades. Moro was slain by the terrorists after a 54-day captivity.

Speaking to both houses, Andreotti asked the four parties which have propped up his minority Christian Democratic government to "salvage a working arrangement" that would permit a stable administration.

But his speech was coolly received except by his own party. He is expected to hand in his resignation to President Sandro Pertini late Tuesday or on Wednesday.

The political crisis was touched off by the withdrawal of the powerful Communist Party last Friday from the five-party pact on which the government relied.

In the Alessandri case, judges, lawyers and other legal personnel walked off their jobs in Milan and Rome to renew their demands for better protection in the face of spreading terrorism.

"We are tired of words and medals," said Piero Pajardi, president of the Milan Tribunal. "We want something concrete."

The National Association of Magistrates sought a meeting with Andreotti to "seek provisions to face up to the dramatic situation in which the magistrature is placed."

The presidential palace announced that Pertini will attend the funeral of Alessandrini. Last week Pertini wept before the coffin of Communist labor leader Guido Rossa, slain by the Red Brigades in Genoa for testifying against a suspected terrorist on trial.

The latest slaying highlighted increasing actions against state officials, particularly prosecutors, prison guards and police officers. Last year, a total of 30 persons were slain in terrorist assaults, twice as many as in the previous year.

Terrorism coupled with spreading unemployment -- up from 1.5 million to 1.7 million in a year -- prompted former premier Moro and his dominant Christian Democrats last year to accept the powerful Communist Party into a governing alliance "of national democratic solidarity." The Communists were denied Cabinet seats, however.

With rank-and-file Communists reported restless over their failure to gain Cabinet seats, the party pulled out of the alliance last week, dooming Italy's 36th government in the last 34 years.