Nicole Eramo, left, and attorney Libby Locke speak with reporters outside the federal courthouse in Charlottesville in November 2016. (Ryan M. Kelly/AP)

Rolling Stone has reached a confidential settlement with Nicole Eramo, a former University of Virginia associate dean who had sued the magazine alleging that it defamed her in a 2014 story about an alleged gang rape on campus, according to lawyers for both parties.

The settlement brings an end to a lawsuit that had roiled the U-Va. community with a case study in the practice and ethics of journalism.

“We are delighted that this dispute is now behind us, as it allows Nicole to move on and focus on doing what she does best, which is supporting victims of sexual assault,” said Libby Locke, a lawyer for Eramo, in a statement Tuesday.

Rolling Stone called the settlement an “amicable resolution.”

The magazine’s November 2014 story, “A Rape on Campus,” recounted the shocking story of a young woman’s gang rape at a U-Va. fraternity house — a story that was discredited after serious flaws were revealed.

(Zoeann Murphy/The Washington Post)

An investigation by The Washington Post showed that aspects of the account were not true. For example, no one in Phi Kappa Psi, the fraternity in question, matched the name or description that the young woman — known as Jackie — gave for the person who allegedly was the ringleader in her 2012 assault.

A person whom Jackie had described to friends at the time as her assailant was complete fiction, according to Eramo’s attorneys, and The Post found that a photo she shared of her alleged attacker was actually of someone she knew from high school, who attended a different university out of state.

The magazine soon acknowledged that it had lost faith in its main source for the story and — after a police investigation and a report by the Columbia University School of Journalism found that aspects of the account were false — ultimately retracted the article.

[Jury awards U-Va. dean $3 million in Rolling Stone defamation case]

In a trial that began in October 2016, Eramo’s lawyers argued that the article’s author, Sabrina Rubin Erdely, had arrived on campus determined to write a story about a university’s callousness to the problem of sexual assault. She did not let facts get in the way of the story, they argued, and she wrongly turned Eramo into the face of institutional indifference.

Eramo testified that she faced threats, lost professional credibility and lost her ability to work as an advocate for sexual-assault prevention.

Tom Clare, one of the attorneys representing Eramo, said during his closing statement that his client had become “collateral damage in a quest for sensational journalism.”

Jackie’s tale “had all the elements of a perfect story,” Clare said. “And when something appears too perfect, it usually is.”

Scott Sexton, an attorney for Rolling Stone, told the jurors in his closing statement that the magazine “acknowledges huge errors in not being more dogged. . . . It’s the worst thing to ever happen to Rolling Stone.”

The article cost Erdely her job at the magazine and her reputation as a journalist, Sexton said. In court documents, Erdely said she was “shattered” to discover that she had repeated falsehoods in her story.

[Rolling Stone’s Erdely on experience with ‘Jackie’]

“This experience has been devastating to me, both professionally and personally. Never in my 20-plus years as a reporter have I had a story or a source fall apart on me after publication. After feeling so sure about the Article, and believing so strongly that it would help spur change on college campuses, losing faith in the credibility of one of my major sources post-publication took me entirely by surprise. I was stunned and shaken by the experience, and remain so to this day.”

In November, a federal jury sided with Eramo, awarding her $3 million in damages — $1 million from Rolling Stone and $2 million from Erdely.

Rolling Stone filed a motion to vacate that judgment, the first step toward an appeal, but then agreed to settle the case before a judge could rule.