With much fanfare, a first group of 61 American convicts serving time in Mexican jails were flown to the United States today as a result of a new U.S. Mexican prisoner exchange treaty.

The long-awaited trip home for the Americans will be followed by three more charter flights - paid for by the U.S. government - returning a total of 234 prisoners to U.S. soil before Christmas. One group of 66 will leave Mexico City Saturday and the rest are to follow next week.

Although the treaty is not strictly a prisoner exchange, 36 Mexicans from American jails arrived here today on the chartered Texas International DC9 that later flew the Americans to San Diego, Calif. They will be held initially in San Diego's Metropolitan Correction Center, but many expect to be freed soon on parole or through mandatory release.

In an unusual ceremony seemingly designed as a media event, the American and Mexican prisoners were lined up on the runway facing each other at a government hangar at the Mexico City airport. Despite the impressive security - close to 600 heavily armed police had cordoned off the area on rooftops - the event was a happy occasion.

American and Mexican officials told reporters they were pleased to reduce a thorny problem between the two countries.

As officials signed documents formalizing the transfer, the prisoners form both nations waved and grinned at each other, They were dressed in new uniforms provided by the U.S. government, the American women in red jackets and dark trousers, the American men in blue jump suits and the Mexicans in yellow coveralls.

As the names of the American prisoners were called through a loud speaker, they were escorted to the plane one by one, accompanied by black belt karate experts of the Mexican police.

American officials had been anxious to avoid a festive event at the airport so as not to create the impression of "herotic return home" for the American convicts, 95 per cent of whom are young people convicted of drug offenses.

Of the Americans who left today, 35 are men and 26 are women. One of the women was accompanied by her 13-month-old daughter who was born in jail.

Mexican Attorney General Oscar Flores, who had taken much personal interest in implementing the transfer, expressed his relief at the departure of the Americans, saying it was like ending "a long pregnancy."

The treaty valid for three years and renewable, is officially aimed at relieving the difficulties of serving long sentences in foreign countries. It is an outgrown of President Nixon's international "war on drugs," declared in 1969.

The U.S. government first pressured Mexico into a joint narcotics crackdown, with financial and technical assistance from Washington. Trained and aided by U.S. narcotics agents, Mexico then began to arrest Americans who came to pick up Mexican-grown maripuana and opium poppies for heroin.

Numerous other Americans were caught here, in transit to the United States with South American cocaine.

Within two years, the arrests of Americans in Mexico tripled, and, encouraged by U.S. authorities, Mexico stiffened its drug laws, establishing a minimum prison term of five years, three months - with no right to parole - for all drug violations.

Those stiff sentences, along with the Americans' horror stories of physical abuse and extortion from lawyers and prison authorities here, helped to turn the plight of Americans in Mexican jails into a human rights cause.

Mexican officials argued that drugs were essentially a U.S. problem and the drug market was in the United States Yet, their crackdown here, and the bad publicity it generated, began to hurt Mexico's vital tourist industry

F"We just can't win. Either we had the American authorities or the American public against us," a high Mexican official said at the time. Last spring, therefore, Mexico proposed the transfer treaty, which would permit a large number of the prisoners to return home.

Several Americans eligible to return this month will have to wait for the next transfer, planned for February. The Mexican authorities have not been able to locate information on their sentences which is needed by U.S. authorities.

Almost 20 per cent of the 577 Americans incarcerated here have offered to stay behind, according to a U.S. Justice Department officials, because they have warrants pending in the United States, have relatives in Mexico or they want to wait and see what happens to the first returnees.