At least four persons were killed when troops fired on Moslem demonstrators in towns of western Iran Sunday, according to delayed reports reaching here yesterday.

The demonstrators were protesting reported Iraqi police harassment of Iranian Sniite Moslem leader Ayatollah Khomeini, who lived in exile in Iraq for 16 years.

Meanwhile, Shah Mohammad Reza Pahlavi granted an amnesty that officials say opens the door to the Ayatollah and thousands of other Iranians living abroad to return home without fear of arrest for opposition to his rule.

United Press International reported that three people were killed in Kermanshah and one in Reziyeh, both in the western part of the country. The newspaper Kayhan said four died in Kermanshah and two in Doroud, also in western Iran.

The clashes Sunday were the worst since martial law was imposed Sept. 8. Hundreds have been killed in clashes over the past several months.

In Kermanshah, more than 8,000 demonstrators shouting "Khomeini our leader!" clashed with troops for several hours. The demonstrators burned down nine banks, a movie theater and several liquor stores.

Press reports said 25 of the injured protesters were in serious condition.

Meanwhile, Moslem clergymen also protested the alleged Iraqi harassment of the exiled Moslem leader by calling a business strike in Tehran and five other cities. Tehran was partially paralyzed Sunday.

Iraq has denied reports that Khomeini is under house arrest.

Iranian Minister of State Manuchehr Azemon said the amnesty declared yesterday applies to Khomeini who has been leading a campaign against the shah and his Western reforms from Iraq. Khomeini has said he will not return unless the monarchy is abolished.

The amnesty was granted to all Iranians involved in "antistate" activities, and one official said thousands could not return home without fear of arrest by SAVAK, the secret police.

In the past 20 years hundreds of Iranian students abroad who were accused of taking part in foreign demonstrations against the shah were arrested when they came home. Many were jailed for up to seven years.

A government spokesman said those already convicted and sentenced would not be affected by the amnesty. At least 1,000 of them have already been released, and the cases of others are under study.

The amnesty was the shah's latest attempt to quiet the recent violent opposition to his government, which has been spearheaded by traditionalist Moslem leaders angered by the ruler's redistribution of lands owned by the clergy and his granting of rights to women.

Leftists, students, intellectuals and members of the growing middle class put aside their ideological differences to join the religious opposition to the Shah.

Hundreds of Iranians have died this year in clashes between antigovernment demonstrators and police. The government contends that the unrest is instigated by Marxists, but much of it is the work of religious conservatives.