Swiss police today rushed the Polish Embassy here in a swift precision raid, freeing five diplomats held hostage inside and capturing the four gunmen who had occupied the building since Monday.

No shots were fired, and no injuries were reported in the mid-morning action that began with the explosion of a remote-controlled bomb that police had concealed in a food basket delivered to the embassy doorstep.

Swiss Justice Minister Kurt Furgler said the assault had been ordered after authorities concluded that negotiations with the gunmen had stalled.

While the seizure had been portrayed by the extremists as a political act to gain an end to repression in Poland, the lead gunman -- who had called himself Col. Wysocki and said he headed the "Polish Insurgent Home Army" -- was identified by Swiss officials as Florian Kruszyk, 42, a Polish emigre who served a nine-year sentence in Austria for the armed holdup of a jewelry shop. Furgler characterized Kruszyk as a "fanatic" driven by a mixture of political and criminal motives.

In addition to demanding the lifting of Poland's nine-month-old martial law, the gunmen had asked for 3 million Swiss francs (about $1.43 million) and safe passage out of Switzerland by air, Swiss officials disclosed today.

In an interview with Swiss radio, Joseph Bochenski, the Polish-born philosophy professor who helped mediate the crisis, said of Kruszyk: "This wasn't at all a political affair. He wanted money."

The daring rescue brought to a bloodless end the first terrorist attack against a Polish institution outside Poland since the imposition of martial law Dec. 13. It was greeted with relief not only by Warsaw officials but also by spokesmen in Europe for the suspended trade union Solidarity, who had condemned the seizure.

For the Swiss, who had shunned offers from other countries including Poland to send antiterrorist units to assist here, the expertly executed raid boosted national pride while underscoring Switzerland's tough public stance against terrorism. Throughout the 72-hour drama, Swiss officials had insisted on the unconditional surrender of the gunmen.

"Nothing is so successful as success," a beaming Furgler told reporters. "We are very happy."

The identity of the other three gunmen in the embassy had not been made public this evening. Furgler said the group had apparently acted without accomplices and would be prosecuted.

In Warsaw, Polish officials expressed "deep satisfaction" and said they would seek extradition of the gunmen if they are Polish citizens, United Press International reported.

But Furgler said the attackers would be tried in Switzerland, noting, "possibly they would prefer being in Switzerland than in some countries where freedom does not have the same value," UPI said.

Furgler said Kruszyk had lived in the Polish village of Wysocko. In 1969 he was arrested in Vienna for robbing a jewelry store and holding hostage, with the help of three others, the family that owned it. He served nine years in prison.

After his release, Kruszyk applied for political asylum in Switzerland but was refused, Furgler said, because of his criminal past and was forced to leave Switzerland.

Kruszyk went to Holland, where he married a Dutch woman, thereby gaining a residency permit. Swiss officials said today that Dutch authorities told them that Kruszyk had made threats against the Polish Embassy in The Hague and had expressed concerns that he was being hunted by Polish security forces.

Furgler appealed to the Polish government not to use the embassy affair as a pretext to move against opposition groups in Poland--a reference to accusations in the Polish press that Solidarity was implicated.

"It would seem to us deeply unjust if one would seek to create a link with people who could never give any backing to the culprits," Furgler said at a press conference. "We hope the authorities in Poland are pleased that they are getting their embassy back intact, that their people have been protected and are free . . . but that innocent people will not have to suffer because of this affair."

The assault was led by the city of Bern's elite antiterrorist "Star" squad. Wearing combat dress, red helmets and gas masks, they charged the building at 10:42 a.m. when a bomb placed in a food basket that had been delivered a minute earlier to the embassy was set off by remote control.

The bomb, intended to stun, not injure, gave off a loud bang and blinding flash and released a cloud of gas.

Moments after the police moved in, one gunman, then two more, and finally the fourth, were pushed out into the street at gunpoint in quick succession. They wore green camouflage fatigues. One had on a gas mask.

The five hostage diplomats, wearing suits and ties and appearing dazed, were led out shortly afterward. The whole operation took 12 minutes.

A police spokesman reported that the gunmen had been holding automatic rifles, but none of the 55 pounds of dynamite they claimed to have had inside was found.

The decision to try to free the embassy by force was made last night, Furgler said, when he asked the Swiss Cabinet to give him a "blank check" for the operation. Tense negotiations with the gunmen had until then produced a two-day extension of the original deadline and the release of eight hostages.

An additional embassy official whose existence had not been known to the gunmen escaped Wednesday night by climbing out of a second-story window.

The rescue plan was almost spoiled this morning when Kruszyk phoned Swiss officials to report that the military attache, who had been discovered belatedly in the embassy compound along with a number of documents described by the gunmen as important and embarrassing to the Polish government, had tried to commit suicide by swallowing some pills.

Medicine was sent into the embassy for the attache, and the gunmen were instructed by phone on how to treat him. The attache was later reported to have recovered.