In Pakistan, Moazzam Khan is a lawyer, local prosecutor and landlord who says he owns five houses, two cars and 2,000 acres of land. His father was a cousin of former Pakistani president Mohammad Ayub Khan.

Yesterday as a witness here in U.S. District Court, Khan, 34, told of his role as a courier who supposedly smuggled five kilograms of heroin, worth $20 million, into the United States. Actually, prosecutors said Khan was cooperating with the U.S. Drug Enforcement Administration in an elaborate "sting" operation that resulted in the arrest of another Pakistani in a Washington hotel.

The defendant, Javed Nawaz, 30, is now on trial before federal Judge Stanley S. Harris on charges of attempting to possess the heroin with intent to sell it.

"I lost a very dear friend to drugs," Khan told the jury yesterday. "He was a doctor and a captain in the army. I have named a street after him . . . . And we have formed this organization, the Green December movement, to remove the source of drugs from this world. I would risk my life to do that."

Wasn't Khan worried about what might happen to his wife and two children if he were to die? asked defense attorney Allan Palmer.

"God gave me life," Khan replied. "He can take it back any time."

Assistant U.S. Attorney Robert E. McDaniel said Nawaz was arrested in the L'Enfant Plaza Hotel on March 27 after he received five packages from Khan that he thought were heroin but actually were a flour and sugar substitute prepared by the DEA.

Nawaz, who had flown to Washington from his home near Chicago, wrapped the packages in newspaper, Khan testified, and carefully placed them in a suitcase hidden beneath some sweaters and an elaborate blue rug used by Moslems for prayer.

The transfer was recorded by the DEA on videotape, which was shown in court yesterday.

Tapes were played of Nawaz's telephone calls to Khan. Nawaz used code words that Khan said identified him as the one to whom the drug was to be delivered.

Khan said Nawaz also identified himself by telling him the serial numbers on a Pakistani 10 rupee note. He said he had been given half of the bill by the source of the heroin in Pakistan.

On the witness stand, Khan said opium poppies, from which heroin is refined, are widely cultivated in Pakistan's Northwest Frontier Provinces near his home. He said he had prosecuted some of Pakistan's most famous drug smugglers and has helped identify and destroy two laboratories where heroin was produced.

Khan said he heard from a "subsource" in January that smugglers were trying to find someone to carry five kilograms of heroin to the United States. He said he contacted American DEA agents stationed in Pakistan about the tip and then arranged to get the drug through the "subsource" himself. He said he turned the packages over to a DEA agent within a half hour.

When Palmer asked for the name of the subsource, Khan refused to disclose it, and Harris said he did not have to do so. "I don't want him to be killed," Khan explained.

DEA Agent Eric Lightfoot said he carried the heroin on a plane flight from Pakistan to Washington with the consent of the Pakistani government. The drug, wrapped in heavy white paper, was introduced as evidence.

The trial is scheduled to continue today.