An Israeli arms dealer who served as an adviser to two Israeli prime ministers and played a key role in the Iran-Contra scandal died in a plane crash in Mexico, Foreign Ministry officials said Friday.

Amiram Nir, 38, was killed when a small plane crashed Thursday about 250 miles from Mexico City, the Foreign Ministry spokesman said. He was identified by his passport, which was found in the wreckage, the spokesman said. The cause of the crash was not immediately known.Nir, who advised Prime Ministers Yitzhak Shamir and Shimon Peres on counterterrorism measures, played a role in the early stages of the Iran-Contra affair by acting as a contact between the United States and Iran.

The Jerusalem Post said Friday that Shamir had retained Nir as an adviser in order to give him immunity from the U.S. investigation into the Iran-Contra episode.

Retired Lt. Col. Oliver North, a former National Security Council staff member and a leading Iran-Contra figure who faces numerous criminal counts in the scandal, had praised Nir for assisting in the capture of the hijackers of the Achille Lauro cruise ship in 1985.

Nir's name surfaced during testimony at Iran-Contra hearings. He helped North arrange in 1985 and 1986 for the shipment of U.S. weapons to Iran in return for release of two Americans held hostage by pro-Iranian groups in Lebanon. Profits from the arms sales then were diverted to the Contra rebel effort in Nicaragua.

The Foreign Ministry spokesman said Nir left the government in April and entered private business. Neither the Foreign Minister nor Israeli officials in Mexico were aware Nir was in the country.

Before joining the government as an adviser to Peres, Nir worked as a military affairs reporter for Israel Television and was a researcher on military and strategic affairs at Tel Aviv University's Jaffee Institute.

Nir's wife, Judy, is the daughter of prominent Israeli newspaper executive Noah Moses, who operates the daily Yediot Aharonot. The Nirs have two sons.