U.N. peace envoy Olof Palme ended a week of talks with Iranian and Iraqi leaders today, appearing satisfied with the first stage of his effort to win agreement on an end to the Persian Gulf war, now in its 10th week.

Communiques from both sides indicated that heavy fighting persisted as Palme left for New York.

Iran's official Pars News Agency reported that Iranian forces launched an attack on Iraqi invaders at Ahwaz, killing 500 soldiers and capturing 26, and said the battle was still raging.

Iranian President Abol Hassan Bani-Sadr said an Iraqi brigade was routed last weekend at Susangerd, and claimed that 400 to 450 Iraqi troops were killed there yesterday.

Palme, the former Swedish prime minister, flew to Geneva and was scheduled to fly to New York Tuesday to brief U.N. Secretary General Kurt Waldheim.

"I can see an end to the war," Palme told reporters at Geneva Airport. "But the conflict is deep and the differences are great. My view that we should not expect rapid results has been confirmed."

"The first part of our mission was to listen, learn and clarify positions of the two parties," Palme said. "We were able to fulfill this." In Baghdad he said, "We must not raise hopes for early results, but the objective reasons for peace are very good."

Asked to give those reasons, Palme said, "These countries have a great need for development and construction and not to spend their resources on war.

He said, "They want to stay independent of the big powers and the risk exists that this war may spread to other regions and involve big powers."

After a three-hour meeting with Iraqi President Saddam Hussein, Palme said, "We have discussed in great detail the different questions; . . . this talk was constructive."

Palme met last week with Bani-Sadr and with Iranian Prime Minister Mohammed Ali Rajai, then visited the Iranian war front at Dezful and Kermanshah.

Hojatoleslam Ali Akbar Hashemi Rafsanjani, the speaker of the Iranian parliament, addressed the Syrian parliament in Damascus. Rafsanjani, who is on a tour of Arab nations seeking to drum up support for the Iranian cause, said the war was not between Iran and the Arabs in general, but between forces of revolution and counterrevolution, Pars reported.

Pars quoted the speaker of the Syrian parliament, Mahmoud Hadid, as saying: "Syria will always support the Islamic revolution of Iran and we hope that our Moslem brother nation of Iran will be victorious in its war with imperialism."

Iraq said in a communique that Iranian planes raided deep across the country, hitting "civilian targets and housing areas" in the north, close to the Turkish frontier.