Gunmen today assassinated a West German businessman in the first such act of terrorism against a foreign resident since the February revolution.

Hans Joachim Leib, 32, was killed by a single bullet in the head as he left his home in a prosperous north Tehran residential district to go to work. His two attackers escaped by motorcycle.

In a note found by Leib's body, responsibility for the shooting was claimed by the mysterious Forqan group, according to a report by the official Pars News Agency. The note charged Leib with supporting Western capitalism and being a polytheist, a term that in Persian can be applied to any non-Moslem.

It was unclear why the assassins singled out Leib, finance manager for the West German Merck pharmaceuticals company, who had been living in Iran with his wife and young son for about a year.

Forqan, which portrays itself as an Islamic fundamentalist group opposed to clerical dictatorship, claimed responsibility for the murder in April of the Islamic republic's first armed forces chief of staff and in May of a senior member of the Iranian clergy believed to have been close to Ayatollah Ruhollah Khomeini.

The British Embassy warned its nationals to take extra precautions after Leib's murder, reflecting a nervousness that is expected to prompt some foreign residents to leave and may deter foreign companies that are contemplating sending staff back to Iran.

"There will definitely be a reaction in our community and many people will leave Iran, I am sure," said one West German diplomat. "People are just looking for an excuse to leave Iran."

Meanwhile, reports from the Kurdish region of western Iran said government security forces have lost control of the Kurdish town of Mahabad in the face of persistent harassment by Kurdish insurgents.

Troops and Revoluntionary Guards, who last night came under a fierce guerrilla bombardment, were siad to have withdrawn to their barracks.

The attack came a day after guerrillas surrounded the governor's office in Mahabad and kidnaped a special representative of Prime Minister Mehdi Bazargan Sadeg Zibakalam.

A letter purportedly sent to the authorities by Zibakalam said he was well and would shortly be released by the kidnapers, apparently after talks with outlawed Kurdish leaders.

Reports have also reached the capital of a clash in the southeastern city of Zahedan between security forces and another predominantly Sunni Moslem ethnic minority, the Baluchis.