Prosecutors in Nantucket on Wednesday dropped a felony sexual assault charge against the actor Kevin Spacey, after watching their case against the actor slowly fall apart under scrutiny from Spacey's defense team during months of contentious pre-trial hearings that unfolded in the resort island's lone courtroom.

The decision to drop the charges followed a meeting between the accuser, his parents and prosecutors on Sunday, July 14, following a July 8 hearing in which the alleged victim exercised his Fifth Amendment right against self-incrimination during a hearing in which he was testifying about his missing cell phone.

"The complaining witness was informed that if he chose to continue to invoke his Fifth Amendment right, the case would not be able to go forward," Cape and Islands District Attorney Michael O'Keefe said in a statement released on Wednesday. "After a further period of reflection privately with his lawyer, the complaining witness elected not to waive his right under the Fifth Amendment."

But the criminal case against Spacey appeared to be plagued nearly from the start by one stunning revelation after another about missteps by the case investigators, the prosecutors and the alleged victim's relatives and civil attorney.

In October, 2017, the young man contacted the Cape and Islands District Attorney's office to allege that 15 months earlier Spacey had plied him with beer and whiskey in July 2016 after the two met at the Club Car bar and restaurant in Nantucket, where the young man had worked that summer as a busboy, and sexually assaulted him.

The alleged victim admitted to authorities from the start that he lied to Spacey about his age, saying he was a 23-year-old college student attending Wake Forest University, when in fact he was an 18-year-old busboy working at the restaurant where he met the actor and sought an autograph for his girlfriend.

The alleged victim told investigators that while Spacey was touching him, he was texting and communicating with his girlfriend and other friends on Snapchat and sent his girlfriend a Snapchat video of Spacey groping him, according to the criminal complaint.

He alleged the inappropriate touching of his genitals continued for about three minutes, according to the complaint. Those texts and videos have been a key focus of heated, pre-trial courtroom debates during previous hearings in the case.

In January, authorities charged Spacey with a single felony count of indecent assault and battery.

But over the course of months of pre-trial hearings, it emerged that the mother of Spacey's accuser had deleted potentially exculpatory data from her son's cell phone before turning it over to police, and that the lead investigator in the case did not file a report stating the mother's voluntary admission until just last month -- in June, 2019 -- more than three years after the alleged encounter.

When Spacey's defense team learned of these developments last month, they sought from the judge in the case and were granted direct access to the accuser's phone.

Defense attorneys, who compared the results of the state's forensic examination of the phone with screenshots of the group chat conversation from that night that the accuser had texted to investigators, concluded that key parts of those conversations had been deleted before the phone was turned over to investigators.

A civil attorney for the accuser then informed the court that the phone had apparently been irretrievably lost -- and even questioned whether police returned the device to the family at all after the government completed its forensic exam of the device's contents.

The accuser appeared in court earlier this month and took the witness stand on orders from the judge to explain what happened to the phone. He testified he did not report the alleged assault to police for 15 months, in October, 2017, rather than the three months prosecutors had been contending since filing charges against the actor in January. The lead investigator in the case testified later that day under questioning from Spacey's defense attorney that the one-year difference was the result of a "typo," and a spokeswoman for the district attorney's office acknowledged the error, for the first time, in response to queries from ABC News.

He also testified that he had turned the phone back over to the accuser's family a few weeks after obtaining it. But the accuser's father went on to testify that he doesn't recall ever receiving the device back, prompting the lead investigator to acknowledge that he was "remiss" and failed to get a signed receipt confirming the return of the phone.

But part of the way through the accuser's July 8 testimony, during questioning from Spacey defense attorney Alan Jackson, a recess was called after the accuser was asked whether he was aware that it's a crime to delete potentially exculpatory data from a piece of evidence in a criminal probe. He said on the stand that he had not been aware of that.

During the recess, the accuser informed the judge through a representative that he had decided to invoke his Fifth Amendment right to protect himself against self-incrimination -- and declined further testimony. That prompted Barrett to order the accuser's testimony stricken from the record.

That led Jackson to demand of Nantucket District Court Judge Thomas Barrett that the case be dismissed on the spot. An assistant district attorney asked for a week to confer with his office.

"This entire case is completely compromised" by the accuser's decision to take the Fifth, Jackson told Barrett. "He's the sole witness than can establish the circumstances of his allegation."

Barrett declined to immediately dismiss the charge, but acknowledged from the bench that "without [the accuser's testimony], the Commonwealth will have a tough row to hoe," adding that it remained unclear whether the case would "continue or collapse" without the testimony of the accuser himself.

Then last month, in the middle of the criminal proceedings, the accuser filed a civil lawsuit against Spacey, a move that confounded legal experts who spoke to ABC News and further jeopardizing the criminal case. The civil lawsuit was withdrawn weeks later.

In Oct. 2017, actor Anthony Rapp claimed in a BuzzFeed interview that Spacey made sexual advances towards him at a party in 1986 when he was 14 and Spacey was 26.

When the story was made public, Spacey posted a statement on Twitter saying he is "beyond horrified" by the story, but doesn't remember the encounter. He went on to say he was examining himself and now chooses "to [openly] live as a gay man."

Rapp's allegation prompted a flood of similar allegations against the actor for groping and other inappropriate behavior over the course of his long career, but to date no other charges beside the now-dropped Nantucket charge have been filed against him.

The accuser's mother, Heather Unruh, is a former longtime New England television anchor at ABC News affiliate WCVB in Boston.

The young man's civil attorney, Mitchell Garabedian, issued a brief statement following the announcement of the dropping of the criminal charge.

"My client and his family have shown an enormous amount of courage under difficult circumstances," Garabedian said in the statement. "I have no further comment at this time."