Emails filed in federal court on Friday show that the Rolling Stone reporter who wrote a now-debunked article about a gang rape at the University of Virginia told colleagues that “our worst nightmare” became a reality after she realized the main source for the story was lying.

Sabrina Rubin Erdely’s emails were filed in federal court in Virginia on Friday as part of a $10 million defamation lawsuit that UVA dean Nicole Eramo filed against the reporter and Rolling Stone.

[dcquiz] In a Dec. 5, 2014 email to Rolling Stone editors Will Dana and Sean Woods, Erdely said that she did not believe the source of her story, “A Rape on Campus,” was “credible any longer.”

Erdely’s Nov. 19, 2014 article relied on the claims of Jackie Coakley, a UVA student who said that she was gang-raped by a group of fraternity members during a party in Sept. 2012. Coakley also said that Eramo and UVA administrators did little to help her.

The article set off a wave of national outrage, with commentators saying that the piece showed how rampant sexual assault is on college campuses. UVA’s president, Teresa Sullivan, suspended Phi Kappa Psi, the fraternity where Coakley claimed she was raped.

The 9,000-word piece soon came under scrutiny, with some observers claiming that Coakley’s claims did not add up. Erdely’s reporting methods also came under fire. She failed to obtain the identities of Coakley’s attackers and of three friends Coakley said met up with her after she claims she was raped.

But Erdely and Rolling Stone stood by the story during the first days of that early criticism.

In one Dec. 1 email exchange filed in the case, Erdely expressed confidence in her story in an email exchange with Washington Post reporter Paul Farhi. In response to a series of questions about holes in the article, Erdely wrote that “we took many steps to verify Jackie’s story and feel confident with what we published.”

By Dec. 5, Erdely had determined that Coakley lied to her.

“By the time we ended our conversation, I felt nearly certain that she was not being truthful,” Erdely wrote to her editors.

“The whole thing stinks.”

She said that she had continued to try to find out the identity of Coakley’s attacker, but when she pressed the student “it spiraled into confusion.”

Other details are provided in the newly-filed court papers, including from the 431 pages of notes that Erdely took during her reporting.

According to The Washington Post, which viewed the documents, Erdely believed even before the article was published that some parts of Coakley’s story were inconsistent.

Coakley had made conflicting claims about the number of men who she said raped her. She also changed her story about what acts took place during the alleged rape.

Erdely was also not able to confirm Coakley’s claims about scars she sustained from the alleged attack, which Erdely reported took place on top of a broken glass table.

“I was trying to look for them earlier and they’re not distinct anymore,” Coakley told Erdely of the scars, The Post reports.

Coakley’s boyfriend also undermined the claim: “I haven’t really seen any marks on your back,” he said, according to Erdely’s notes.

Erdely’s records also show that during one trip to Charlottesville to report the story, she snuck her way into the Phi Kappa Psi fraternity house.

According to The Post:

At one point, she even talked her way into the Phi Psi fraternity house and ventured to the top floor — where Jackie said she had been raped — saying that she and other students acting as her guides needed to use a restroom. The notes show that Erdely did not identify herself as a reporter when confronted by members of the fraternity who saw the women in the house.

Follow Chuck on Twitter