Charles Lewis, who testified for the government in the cocaine trial of D.C. Mayor Marion Barry, was arrested early yesterday in the U.S. Virgin Islands and charged with drug possession, police there said.

Lewis was arrested by a St. Thomas police officer who saw him in a car parked in a parking lot, law enforcement officials said yesterday. The officer smelled what he said was the aroma of crack cocaine, searched the car and found drugs, officials said. A court hearing was scheduled for Tuesday.

Under the terms of Lewis's parole, the arrest could send him back to prison for at least three years, perhaps longer if he is convicted on the new drug charge.

Judy Smith, a spokeswoman for U.S. Attorney Jay B. Stephens, said yesterday that officials here "will consult with the U.S. Attorney's Office in the Virgin Islands to determine what action to recommend to the court."

Lewis testified in the Barry case that his 1989 cocaine conviction in the Virgin Islands was "a wake-up call" to get his life in order and cooperate in the Barry investigation.

Lewis's Washington attorney, Mark L. Shaffer, said that he had no information about Lewis's arrest, but that if true, the new charge "is tragic."

"Because there's no sales allegation, it would represent a medical problem, and I hope it is dealt with as a medical problem," Shaffer said. "If it is true, it shows the incredibly addictive powers of crack cocaine."

Lewis has been convicted of drug charges twice. The first conviction was in April 1989, after he was arrested in an FBI sting in the Virgin Islands. At trial, his lawyer said Lewis was a pathetic drug addict. Lewis later served 13 months in prison for a drug conviction in Washington.

After Barry's trial last summer, Lewis returned to the Virgin Islands to face sentencing in the case there. A prosecutor urged that, in exchange for his cooperation, he not be sent back to jail. The judge sentenced him to five years' probation. If found to have used drugs during that period, he could be sent to prison for three years or more.

Both of Lewis's convictions grew out of his role in the Ramada Inn episode of Dec. 22, 1988, in which Barry was visiting Lewis in his hotel room as D.C. police detectives arrived to attempt an undercover cocaine purchase from Lewis.

When the detectives learned Barry was in the room, they broke off their operation. In subsequent efforts to uncover information about Barry, authorities aggressively investigated Lewis, following him to the islands for a sting. He became a government informant in summer 1989.

Barry was convicted of cocaine possession Aug. 10 and sentenced to six months in prison. The mayor is appealing the conviction. Barry was acquitted of a second possession charge, and the jury was unable to reach a verdict on 12 additional counts, including eight based at least in part on Lewis's testimony.

Lewis was released from prison in June, days before he testified against Barry.

The leadoff witness for the prosecution in the Barry trial, Lewis held the courtroom almost spellbound describing his drug experiences with the mayor.

Lewis had held management positions in the Virgin Islands and District governments, and had served as a manager in the ill-fated D.C.-Virgin Islands personnel project.

Lewis testified about using drugs with Barry in Washington in 1988 and in the Virgin Islands in 1986 and 1988. He also told of how Barry fashioned a crack pipe out of a sherbet glass, and how Barry once asked for a Coke -- not cocaine, but a Coca-Cola can -- to use as a smoking device.