Kevin Spacey attends the Build Series to discuss his new play 'Clarence Darrow' at Build Studio on May 24, 2017 in New York City.

Massachusetts prosecutors on Wednesday dropped a criminal groping case against actor Kevin Spacey, saying the man who had accused the Academy Award winner of fondling him as an 18-year-old in a Nantucket bar in 2016 now is unavailable as a witness.

The case was dismissed a week after Spacey's accuser refused to testify at a July 8 court hearing about his missing cellphone and deleted text messages, which Spacey's lawyers claimed could prove the actor's innocence.

The accuser invoked his Fifth Amendment right against self-incrimination at that hearing after being asked if he knew that destruction of evidence was a felony under Massachusetts law.

Spacey's lawyer asked for the case to be dismissed immediately at the hearing.

Nantucket District Court Judge Thomas Barrett said at the time that he would give the accuser's attorney time to decide how to proceed. But Barrett acknowledged, "The matter may well be dismissed for the reason indicated."

In a document filed Wednesday, Cape & Islands District Attorney Michael O'Keefe said he was filing a "nolle prosequi," or abandonment of the case against the 59-year-old Spacey, "due to the unavailability of the complaining witness."

Spacey was being prosecuted under his legal name, Kevin Fowler.

The accuser's lawyer, Mitchell Garabedian, in a statement said, "My client and his family have shown an enormous amount of courage under difficult circumstances."

"I have no further comment at this time," Garabedian said.

The accuser alleged that Spacey got him drunk in the Club Car bar on the island of Nantucket, and then groped him. The accuser at the time worked as a busboy in the saloon.

The man's mother, former Boston news anchor Heather Unruh, in November 2017 went public with claims that the actor stuck his hand down her son's pants and grabbed his genitals.

Spacey had pleaded not guilty to a felony charge of indecent assault and battery, which was filed last year.

After the charge was announced, Spacey released a video using the voice of President Frank Underwood, his character on Netflix's political drama "House of Cards."

"I'm certainly not going to pay the price for the thing I didn't do," Spacey said on the video. It was unclear whether he was referring to the case in Massachusetts.