Five months ago, the Drug Enforcement Administration began an undercover investigation of William Morgan Hetrick, a pilot and inventor who was running an airport services company in the Mojave desert. Two months later, DEA agents say that sports car creator John Z. De Lorean approached one of their informants allegedly because he wanted to finance a drug deal to raise money to save his company.

Shortly after, an assistant U.S. attorney here decided to bring the two men together, according to a government source.

Today, both men sit in jail, charged with conspiracy to distribute cocaine in what government officials have alleged was a multimillion-dollar scheme.

On July 11, according to papers filed by the government here, De Lorean met with a DEA undercover informant and "discussed a narcotics transaction." The informant told De Lorean he would introduce him to his boss.

Soon after, De Lorean and the informant met with a DEA agent -- the boss -- who was posing as a drug trafficker. During that session, the industrialist repeated his need for a great deal of money to save his failing car manufacturing plant in Northern Ireland, a source said.

Two months before De Lorean appeared on the scene, DEA had begun a different undercover investigation directed at Hetrick, who federal officials suspected of being a major drug smuggler. The high-living Hetrick had come to the attention of DEA and local police as a possible smuggler more than a year earlier.

An undercover DEA agent approached Hetrick in May, 1982, a government source said, and asked to use his airport facilities "with no questions asked." Within a short time, the source said, the undercover agent believed he could arrange for Hetrick to deliver cocaine in return for funds.

Assistant U.S. Attorney James Walsh and agents of the FBI and DEA decided to bring the two men together. DEA agents were nervous about bringing De Lorean into the Hetrick investigation, fearing they would lose a case against an allegedly major drug dealer. But Walsh prevailed, sources said.

After that session, De Lorean, the undercover DEA agent and the DEA's informant met in Washington, according to papers filed by the government.

In a room at the L'Enfant Plaza Hotel on Sept. 4, De Lorean "agreed to furnish $1.8 million in cash, which would be used to purchase part of the narcotics," with any additional funds to be put up by the DEA undercover agent. In addition, the DEA undercover man would "also distribute the narcotics," the court papers say.

De Lorean's only alleged role would be to put up money for part of the deal.

According to an FBI affidavit, the meeting between De Lorean and Hetrick occurred Sept. 20 in the Bel Air Sands Hotel here. Also attending was an undercover FBI agent who was posing as a money launderer.

One source close to the investigation said Hetrick and De Lorean had been acquainted previously. Although De Lorean had not known of Hetrick's alleged drug activities until this meeting, the previous relationship appeared to make him more confident of the arrangement.

The conversation at the meeting, the sources said, made clear that De Lorean did not plan to handle any drugs himself.

According to the affidavit, Hetrick discussed with De Lorean and the undercover FBI agent the purchase of 220 pounds of cocaine. Hetrick said he could get it for $2.5 million wholesale outside the country, but that would take about 10 days, while he could get it immediately from a source in San Francisco for $5 million.

Distribution would be handled by the DEA undercover agent, according to the affidavit. Hetrick agreed to go ahead, the affidavit said.

It was the next meeting between De Lorean and the DEA agent -- a Sept. 28 session at the Bonaventure Hotel here -- at which De Lorean allegedly committed the act that would form the basis for the charge against him, sources said. The DEA agent said he and De Lorean would split the wholesale cost of the alleged $5 million deal, according to the affidavit, with De Lorean putting up $1.8 million and the government agent $3.2 million to purchase the cocaine from Hetrick, according to the affidavit.

In that same meeting, the affidavit says, after the first $60 million profits from the drug sales were turned over to De Lorean, the DEA undercover agent "was to own a 50 percent share of DMC De Lorean Motor Co. ."

When De Lorean was arraigned Wednesday, Walsh said in court without further elaboration that De Lorean had signed over shares in his car company to a "James Benedict" on Sept. 30. Investigators have said James Benedict was the cover name used by the FBI undercover agent.

Sources said the government believes this act was all that was necessary to charge De Lorean with conspiracy to possess with intent to distribute the cocaine.

A spokesman for the U.S. attorney's office here said a bail hearing for De Lorean was not scheduled until Monday, indicating he will have to spend the weekend at the federal correctional institution at Terminal Island near Long Beach, Calif.

De Lorean has been unable to raise the $5 million bond set at his arraignment.