The nation's highest military court yesterday overturned the conviction of Cpl. Lindsey Scott, a black Marine whose sentence of 30 years at hard labor for the rape, sodomy, abduction and attempted murder of a white woman at the Quantico Marine Corps base in 1983 stirred protest nationally from civil rights groups.

In deciding unanimously to set aside the conviction, the three-judge U.S. Court of Military Appeals found that the failure of Scott's civilian attorney to prepare a competent alibi defense in the court-martial "casts doubt" on the conviction.

According to Marine Corps and Navy sources as well as Scott's new civilian attorney, the court's ruling -- while it does not require it -- probably sets the stage for a dramatic retrial of Scott, a 31-year-old husband and father whose service record was unblemished before he was charged with the brutal attack.

"My best guess is that they will retry," said John F. Leino, Scott's chief attorney. Several military lawyers familiar with the case said that the decision yesterday does not necessarily weaken the evidence against Scott and that they remain confident that they could get a conviction if there is a new trial.

Nonetheless, Scott's family, friends and attorneys and civil rights workers were jubilant.

"We hollered and screamed and jumped up and down and cried," said Scott's wife Lolita, who lives in Louisville. Said Scott's father, James W. Scott Sr., who received the news in a telephone call from Sen. Wendell H. Ford (D-Ky.): "We almost went crazy, 'cause for four years we been fighting this. We were not going to give up. It was a frame-up from the start."

Leino said he will file a pretrial release motion immediately to have Scott freed from Fort Leavenworth, Kan., where he has been serving his sentence. Scott could not be reached for comment. He has maintained his innocence from the outset.

Yesterday's decision upsets the outcome of Scott's court-martial as well as the majority opinion of a divided lower court, the Navy- Marine Corps Court of Military Review, which ruled last year that the evidence against Scott was so strong that his attorney's performance made no difference in the trial's outcome.

The court yesterday disagreed. It said much of the decision turned on the lapses of Scott's original civilian attorney, Ervan E. Kuhnke Jr. of Dumfries, whose name Scott selected from the Yellow Pages when he decided he needed a lawyer.

After he was retained, Kuhnke did not attempt to confirm Scott's alibi, nor did he interview or prepare several witnesses who might have been able to establish Scott's whereabouts during the night of the attack, April 20, 1983.

In previous hearings, Kuhnke has contended that at first he did not believe that the government would take Scott's case to court.

Once the case was prosecuted, Kuhnke has said, he was confident that Scott's stated alibi -- that he had been shopping for his wife's birthday present -- would suffice.

In overturning the conviction, Judge Walter T. Cox III wrote that "Kuhnke's failure to promptly investigate was not the result of strategy or a reasonable decision not to investigate. Rather, it was simply the result of a lack of preparation."

Cox added that "the government's evidence at trial was strengthened by the unpreparedness and lack of investigation by" Kuhnke. "This deficiency casts doubt on the reliability of the adversarial testing process of the trial."

Scott became a suspect in the case almost immediately after the victim, the 23-year-old wife of a military policeman who worked with Scott, was found bleeding and dazed on the Quantico base.

She told investigators she had been lured from her apartment hours earlier by a telephone call from a man who said her husband had been in an accident and who offered to take her to the hospital.

Instead of driving to the hospital, however, the man drove her to a remote spot, raped her, choked her, stabbed her in the neck, slashed her throat and left her for dead.

The victim twice identified Scott as her assailant, first from a group of photos and then from a lineup, but each time she equivocated, saying other men in the groups resembled him. In interviews with investigators, however, she offered a detailed description of the interior of Scott's car.

It was not until the court-martial that she seemed sure of herself in identifying Scott, and, as Scott's lawyers have emphasized, she never remarked about his prominent gold front tooth.

Moreover, prosecutors offered no conclusive medical proof to corroborate the woman's testimony that she had been raped. Physical evidence also was scanty. The knife used in the attack was never found, and no witness came forth.

Civil rights groups, including the NAACP and the Southern Christian Leadership Conference, have contended that the military victimized Scott because of his race -- an allegation that the Marine Corps has denied.

Scott's chances for a retrial brightened two years ago when, for the first time, a witness testified at an evidentiary hearing that Scott was at a department store miles from the Marine base when the victim was abducted.

The witness, a former store detective at Zayre in Woodbridge, had said in the court-martial that she was unsure of the date she had seen Scott. But in the hearing she reversed herself, explaining that she became certain of the date after the court-martial when she checked store records.

If there is a retrial, as sources said is likely, one question that may cloud the outlook is whether the victim, who has moved to another part of the country, will testify again. Two years ago, at the conclusion of an evidentiary hearing, one military prosecutor said, "She wants to put it behind her; she wants to forget it."

Staff writer Mary Jordan contributed to this report.