A D.C. Court of Appeals panel, in a rare ruling yesterday, overturned the felony murder conviction of a 22-year-old District man and ordered his acquittal on grounds that the man was unable to cross-examine a key prosecution witness who claimed a memory lapse on the day of trial.

Court authorities and lawyers said yesterday that the unanimous ruling by the three-judge panel was the appellate court's first acquittal in nearly four years involving an offense as serious as murder.

Melvin Thomas is serving a 30-year sentence, but his attorney, Thomas Abbenante, said he expects to move for Thomas' release from prison within 21 days. Thomas has been held without bond since November 1983. "It was a long, hard fight and I'm glad we won, because I think justice has been done," Abbenante said.

Thomas was convicted three years ago of felony murder, armed robbery and carrying a pistol without a license in connection with the November 1981 shooting death of William Michael Reed during an alleged price war among competing drug sellers.

A key moment in Thomas' trial came when Leroy Farley, the government's only witness to the slaying, said he could recall nothing about the crime. Farley had described the slaying at an earlier trial in which two of Thomas' alleged accomplices were convicted.

Yesterday's opinion, written by retired Judge George R. Gallagher, held that Superior Court Judge Eugene Hamilton erred when he permitted prosecutors to read Farley's testimony from the earlier trial. They said Hamilton's action made it impossible for Thomas to confront his accuser.

Although the judge barred mention of Thomas' name in the reading of the transcripts, it inadvertently came up a few times. The government introduced the testimony to show that the shooting occurred during the commission of a felony. Two other prosecution witnesses at Thomas' trial said they had seen Thomas running from the scene after hearing gunshots, but had not witnessed the shooting.

Appeals courts rarely acquit defendants, and instead generally order new trials. But the appeals panel said Hamilton's error was prejudicial enough to warrant an acquittal, saying that without Farley's testimony, there was "insufficient evidence to sustain a conviction."

"As the framers no doubt recognized, testing the accuracy and credibility of witnesses presented against an accused is vital to the fact-finding process," the opinion said.

The U.S. attorney's office could ask the full Court of Appeals to reinstate the conviction, but a number of lawyers said the panel's unanimous ruling made such a course less likely to succeed. The full Court of Appeals reinstated a felony murder conviction four years ago, but that case involved a split decision.