MEXICO CITY, OCT. 9 -- Rafael Caro Quintero, a multimillionaire marijuana trafficker jailed on charges relating to the 1985 murder of a U.S. Drug Enforcement Administration agent, was preparing an escape through a professionally excavated tunnel discovered by authorities here, according to Mexican law enforcement officials.

Leading from beneath a two-story cinderblock house across the street from the high-security northern Mexico City penitentiary, the tunnel burrowed through 780 feet of hard soil to a point below the cell block where Caro and many of his associates are detained.

Investigators said the final vertical section would have required about two more weeks. The project to date may have taken a year.

The Mexican attorney general's office announced the tunnel's discovery last Saturday. Reports of its existence had been circulating unofficially for at least a month.

The escape plan was discovered through prison informants, one government source said. When the site was raided no workers were present and no arrests have yet been made, the attorney general's office said.

More than a dozen other inmates, most of them close associates of Caro jailed in the same block, were also planning to flee through the tunnel, the sources contended.

One of the intended escapees, they said, was William Morales, a Puerto Rican independence activist and convicted bomb planter who was captured in Mexico after escaping from a New York jail.

Among the plotters, officials said, was Ernesto Fonseca, a senior drug ring leader associated with Caro. A defense attorney representing the two traffickers said Tuesday that his clients "did not have anything to do with building the tunnel." Caro's lawyer also issued a denial.

The tunneling had been halted pending the outcome of Caro's trial, which is expected within a month or two, an informed source said. Caro faces multiple counts of illegal drugs and arms possession. He is also accused of participating in the kidnaping and subsequent murder of Enrique Camarena Salazar, of the U.S. Drug Enforcement Administration, who was abducted near his Guadalajara office on Feb. 7, 1985. The murder charge is one of several carrying a penalty of up to 40 years.

A year ago, investigators said, several unidentified men paid cash for two adjacent houses facing the prison. The houses overlook a street busy with bus and pedestrian traffic and offer an unimpeded view of the penitentiary and its watchtowers. Neighbors noted that the new occupants kept odd hours, but said they otherwise paid little heed to the men's activities.

The excavation began with a room-wide shaft 25 feet deep. At the pit's muddy floor, the tunnel is 4 feet high and 6 feet wide. The bore narrows as the tunnel progresses, shored up by wooden supports. It is electrically lit for its full distance.

Jose Antonio Donnaideu, a civil engineer employed by the Mexico City prisons bureau, expressed guarded professional admiration as he inspected the site Wednesday. Given the presumably small work crew, the excavations would have required "months" of around-the-clock digging, he estimated.

The escape attempt recalled a similar tunneling venture a decade ago by Alberto Sicilia-Falcon, a Cuban American then considered the most powerful of Mexico's drug traffickers. He purchased a house across the street from his Mexico City prison and financed a tunnel through which he escaped. He was recaptured by Federal Judical Police Commander Florentino Ventura, who is leading the current investigation.

Since the November 1984 discovery of a record 8,000-ton marijuana cache that police linked to Caro, and the scandal surrounding Camarena's death, the drug czar has emerged as Mexico's leading "criminal celebrity," a U.S. official noted. Films and folk ballads depicting Caro's exploits have been commercial hits and popular magazines run accounts of his reputedly luxurious prison life style.