A lawyer who formerly represented internet freedom activist Aaron Swartz on hacking charges said Monday he told federal prosecutors about a year ago that Swartz was a suicide risk.

Swartz, 26, was found dead of an apparent suicide in his New York apartment Friday.

He had been facing a potentially lengthy prison sentence after being indicted in Boston in 2011 for allegedly gaining access to academic articles from a computer archive at the Massachusetts Institute of Technology. The charges carried a maximum penalty of decades in prison.

Andrew Good, a Boston attorney who represented Swartz in the case last year, said he told federal prosecutors in Massachusetts that Swartz was a suicide risk.

"Their response was, put him in jail, he'll be safe there," Good said.

A spokeswoman for U.S. Attorney Carmen Ortiz declined comment.

"We would like to respect the family's privacy," said Christina DiIorio-Sterling. "We don't think it's appropriate to discuss the case at this time."

Swartz's most recent attorney, Elliot Peters, said prosecutors told him two days before Swartz's death that Swartz would have to spend six months in prison and plead guilty to 13 charges if he wanted to avoid going to trial.

Peters said he and prosecutors had talked repeatedly about making some sort of plea deal, but had failed to come to any agreement. Then last Wednesday, Peters brought up the possibility of a deal again. He said he told prosecutors "that we should find a way to resolve the case that didn't destroy Aaron's life."

Peters said prosecutors made it clear their position had not changed: they wanted Swartz to plead to 13 counts and the government would seek six months of prison time or some "slightly lesser" amount of time.

Elliot said they rejected the deal and he believed they would win the case at trial, which was scheduled to begin in April.

Prosecutors dismissed the charges against Swartz on Monday.

Ortiz and the lead prosecutor in the case, Assistant U.S. Attorney Stephen Heymann, filed a brief written notice in court, saying the case was being dismissed because of Swartz's death. Such filings are routine when a defendant dies before trial.

Swartz's family says his suicide was "the product of a criminal justice system rife with intimidation and prosecutorial overreach."

'Horribly overblown'

Before the charges had been dropped, Elliot Peters, Swartz's California-based attorney and a former federal prosecutor, said on Sunday that the case was "horribly overblown" because Swartz had "the right" to download from JSTOR.

Peters said even the company took the stand that the computer crimes section of the U.S. Attorney's Office in Boston had overreached in seeking prison time for Swartz.

Peters said JSTOR's attorney, Mary Jo White — the former top federal prosecutor in Manhattan — had called Stephen Heymann, the lead Boston, Mass., and prosecutor in the case.

"She asked that they not pursue the case," Peters said.

Reached at his home in Winchester, Mass., Heymann referred all questions to a spokeswoman for the U.S. Attorney's Office in Boston, Christina DiIorio-Sterling. She did not immediately respond to an email and phone message from the seeking comment.

JSTOR regrets involvement

In an unattributed letter of condolence on its website Monday, JSTOR said it "regretted" being drawn into the federal case "from the outset," and called Swartz a "person who made important contributions to the development of the internet and the web from which we all benefit."

The company said that Swartz had returned the data he had in his possession and any civil claims were settled in June 2011.

Issuing its own statement over the weekend, MIT president L. Rafael Reif expressed his condolences to the friends and family of Swartz, and promised a probe of the school's proceedings against him since 2010.

"It pains me to think that MIT played any role in a series of events that have ended in tragedy" Reif said in a statement. "I have asked that this analysis describe the options MIT had and the decisions MIT made, in order to understand and to learn from the actions MIT took. I will share the report with the MIT community when I receive it."

With files from CBC News