MIAMI (AP) _ A Panamanian president received at the White House by President Reagan was elected with the help of millions of dollars from Colombian drug kingpins, according to a witness in Manuel Noriega's trial.

Nicholas Ardito Barletta was received in the Oval Office by Reagan in July 1984, two months after his election. Reagan then sent Secretary of State George Shultz to his inauguration, and Barletta later agreed to help the United States isolate the leftist government in Nicaragua.

The Medellin cartel's alleged support for Barletta surfaced Thursday in prosecution testimonXg. :0 y at Noriega's drug-trafficking trial by the former head of the Panamanian Air Force, Col. Lorenzo Purcell.

Noriega is accused of taking bribes from Colombia's Medellin drug cartel to ensure safe passage of cocaine through his country to the United States.

He faces up to 140 years in prison if convicted on all 10 drug and racketeering counts.

Purcell said that in a meeting of the general staff, he, Noriega and others were told two Colombians were angered about a May 1984 raid on a cartel drug lab in a remote Panamanian province.

The Colombians said they had paid millions of dollars to Noriega's aide, Col. Julian Melo, to protect that lab, with the understanding Noriega was to receive part of it.

''It was also said that the ex-President Ardito Barletta - that part of the money was used to support the election that had taken place a few weeks earlier,'' Purcell testified.

Barletta was later overthrown by the military after trying to set up a commission to investigate charges that Noriega had a political rival killed.

Prosecutors have said the Medellin cartel paid about $6 million to protect the lab, and that Noriega had to return the bribe after the dispute was mediated by Fidel Castro in Cuba. The raid on the laboratory was an error made by uninformed military officials who mistook it for a guerrilla camp, prosecutors contend.

Purcell said that at that same staff meeting, Noriega strongly denied any knowledge of the bribe and had Melo investigated by five colonels. They kicked Melo out of the military and turned him over to civilian authorities. Melo was never tried in a criminal court, however.

Lead prosecutor Michael Sullivan suggested that Melo was used as a scapegoat to protect Noriega.

Purcell was followed on the stand by former Noriega co-defendant Eduardo Pardo, who has pleaded guilty to flying $800,000 in laundered drug money from Fort Lauderdale to Panama.

Pardo testified that on one occasion in 1983 he flew cartel chief Gustavo Gaviria into Panama City, where he was met personally by Melo, Noriega's secretary, who embraced him warmly.

''Where did he get those affectionate embraces from?'' Pardo said he asked Melo.

''He's a friend of the house,'' responded Noriega's aide, according to the witness. Pardo was to undergo cross-examination when the trial resumes Tuesday.