CHARLOTTESVILLE -- Fourteen years of legal sparring over a $5 bar tab that Denis R. O'Brien refused to pay as a University of Virginia graduate student ended this week when the state Supreme Court ruled that earlier judgments against him were invalid because of a legal technicality.

O'Brien lost his blank bar tab during a brief visit to the Mousetrap, a now-defunct watering hole, in February 1980. He refused to pay a $5 penalty charge to the restaurant. O'Brien insisted that he hadn't purchased any drinks and shouldn't have to pay.

When O'Brien started campaigning to change the restaurant's policy of giving blank tabs to customers as soon as they walked in, the Mousetrap's owners filed suit against him, alleging damage to their business reputation. O'Brien, who had moved to Massachusetts, said he was never served with the lawsuit. In his absence, the Mousetrap in 1982 won a $64,000 judgment. With interest, O'Brien's debt ballooned to $156,000.

The restaurant chased O'Brien all the way to New Zealand, where a judge refused to enforce the judgment.

The Virginia Supreme Court finally threw out the judgment this week because the Mousetrap, which closed in 1983, had filed paperwork in the case improperly. One of the affidavits was signed by the restaurant's attorney instead of its owner.

For O'Brien, the news came as a shock.

"It was like all of a sudden waking up from a bad dream," he said. "A lot of people saw this as a little guy fighting the odds and trying to stand up against a powerful system. I hope this encourages people in the same situation to stick it out."

Dianne B. Brubaker, the Mousetrap's owner, may ask for a retrial, but "with all the time this has taken, she may just say that it's not worth it," said John C. Lowe, who represented her in the 1982 lawsuit.

Lowe said the court's ruling was on "a hyper-technicality, but the court has to declare what the law is, and it did."

O'Brien, 46, a former pharmacology professor, has been living on borrowed money in Charlottesville for much of the last two years. A Circuit Court judge found him to be indigent earlier this year, allowing him to appeal his case to the Supreme Court without posting a bond equal to the $156,000 debt.

O'Brien wrote most of the legal briefs and said he discovered the other side's technical error through his own research. He said he may return to the field of science or enter the legal profession.

Either way, his cat-and-mouse legal dispute with the restaurant, which has captured the attention of television shows such as "American Journal," is not over. O'Brien has filed two lawsuits, one seeking $1.2 million from the Mousetrap's owner for breach of contract, and another seeking $100,000 from its attorney for defamation.