IGALO, Yugoslavia (AP) _ Yugoslavia's warring leaders, declaring their country was days away from all-out civil war, today signed a cease-fire agreement brokered by the European Community.

It was not clear whether the agreement reached in this southern Yugoslav resort would meet with any more success than previous accords that failed to halt fighting in which at least 400 people have died since June. The new cease-fire was to begin at noon Wednesday, the Tanjug news agency said.

As if to underline the severity of the situation in Croatia, Yugoslav navy warships 25 miles from Igalo today blockaded Croatian ports along the Adriatic coast, the vessels' gray outlines visible in the mist offshore.

Federal officials also said today that air space over Croatia had been closed off since Monday.

In other developments today:

-Large-scale army mobilizations were reported in parts of Croatia and Serbia and neighboring Bosnia-Hercegovina and Montenegro.

-Heavy fighting was reported on the strategic Belgrade-Zagreb highway and at the main naval submarine base in Sibenik.

-Gunboats reportedly opened fire on the Renaissance cathedral of Sibenik and damaged it.

-Stipe Mesic, a Croat who is chairman of Yugoslavia's collective presidency, appealed for the U.N. Security Council to debate Serbia's effort to ''change the internal Yugoslav borders and annex neighboring republics.''

The fighting pits secessionist Croatia against minority Serbs in the republic who oppose independence. Federal forces have been fighting on the side of the Serbs, according to European Community officials and Croat militants.

All sides at the EC-sponsored talks in Igalo acknowledged ''deep and dangerous divisions'' remain. But, in a statement read by EC negotiator Lord Carrington of Britain, they added, ''We recognize this is the last chance for a de-escalation and cessation'' of the violence.

''We pledge ... that everyone within our control and under our political and military influence should cease fighting immediately,'' said the statement.

It was signed by the presidents of Serbia and Croatia, federal Defense Minister Veljko Kadijevic and Carrington.

Carrington read the statement from a U-shaped table, flanked by Croatian President Franjo Tudjman, Serbia President Slobodan Milosevic, Kadijevic and the federal army chief of staff, Gen. Blagoje Adzic. Somber-faced, each of the parties refused to answer any questions and left immediately afterward.

''This country is only days away from a state of irretrievable civil war,'' the statement said. ''On that, at least, there is no argument.''

The statement did not address how the accord will be implemented and monitored. An unarmed EC delegation of about 200 cease-fire monitors is now in the country, but they have avoided battle zone.

The latest accord comes as Croatian forces are losing ground on the battlefield. They have lost one-third of Croatia's territory to Serb rebels since the republic declared independence on June 25.

Tudjman would appear to be taking a big political risk by trying to impose a cease-fire on his forces. Despite the loss of large chunks of territory, he has been under pressure to expand the republic's military effort.

Croatia accuses Serbia, the largest of Yugoslavia's six republics, of fighting to expand its territory. Milosevic says Croatia must give up Serb- dominated areas if it secedes from Yugoslavia.

About 600,000 ethnic Serbs live in Croatia, or 12 percent of the population. They refuse to live in an independent Croatia.

Carrington said it was ''imperative for the forces on the ground instantly to withdraw sufficiently to guarantee a genuine and total cease-fire.''

According to the statement:

''This means that instantly and simultaneously all armed formations, including the paramiltiary forces, irregular units, the national guard and the Yugoslav army, shall withdraw from immediate contact and from actual or previous areas where hostilities have taken or are taking place.

''All paramilitary forces and irregular units shall disarm and disband, the Croatian national guard reserve forces shall be demobilized, the army shall return to barracks,'' it added. ''This process shall be immediate and simultaneous.''

The breakthrough came hours after federal authorities said today in Belgrade that it had sealed off Dubrovnik and Croatia's other main ports, and that air space over Croatia had been closed for a day.

A Yugoslav air force jet was reported downed in eastern Croatia, the Tanjug news agency said, quoting sources. It said the pilot safely ejected but gave no further details. Another warplane was downed Monday.

According to a navy statement, the ports of Rijeka, Split, Pula, Zadar, Sibenik, Ploce had been blocked. Navy ships would shoot at any vessel trying to leave or enter the ports, it warned.

The blockade could seriously hurt Croatia because much of what it imports as a republic comes through its ports.

EC leaders have stopped short of considering military intervention in Yugoslavia to help resolve the nearly 3-month-old conflict.

The American ambassador to NATO said today that U.S. officials believe ''the fundamental approach of the EC to this problem and the EC's taking the lead is the most promising one.''

But William H. Taft IV said in Brussels that the United States has not yet ''reached any hard conclusion'' on a EC proposal Monday to send a lightly armed military force.

Meanwhile, the federal army claimed Monday to have ''destroyed'' Croatian units blocking a major air force base near Zadar.

Tensions have been fueled by ethnic divisions, memories of the World War II slaughter of Serbs by a Nazi puppet regime in Croatia, and the retaliatory killing of thousands of Croats at the end of the war.