Iran and Iraq have agreed to participate in U.N.-brokered talks here next week to work out the details of a truce that may silence the 8-year Persian Gulf war.

In an attempt to unclog the peacemaking process, U.N. Secretary General Javier Perez de Cuellar invited the foreign ministers of both countries to discuss a cease-fire and schedule for implementing Security Council Resolution 598, which outlines a comprehensive settlement in the gulf.

Iraqi Ambassador Ismat Kittani said that Foreign Minister Tariq Aziz would reach New York early next week "to discuss the modalities." In addition, Iraq said it would welcome a team of U.N. military experts to Baghdad to work out the technical issues involved, in achieving a cease-fire and a mutual withdrawal to borders. Iraq previously refused to accept the panel's visit.

Iraq had called for direct talks between the two foreign ministers, but the secretary general made it clear that the officials would be coming to New York "to enter intensive discussions with me on various aspects of my implementation plan."

This does not rule out a face-to-face meeting, but suggests that negotiations would begin with Perez de Cuellar shuttling between the two sides, as he has done in the past.

Kittani did not challenge this procedure but said, "we still think our suggestion of direct talks would be the best way."

Iran also protested to the secretary general and the Security Council Thursday, saying Iraq had launched extensive attacks, aimed at overtaking border areas. Tehran accused Baghdad of staging air-raids against Iranian cities and using outlawed chemical weapons against civilians in three sites, killing at least 80 and injuring more than 600.

Iran said Iraq recaptured two salients of Iraqi territory _ Saif Saad and Sanuba, both in the central border area _ that had been held by Iranian troops.

Despite the fighting, Iran remained eager to press early arrangements for a cease-fire.