US attorney Carmen Ortiz, who led the fraud case against Aaron Swartz until his suicide last week, has defended her prosecution of the internet prodigy.

Swartz, 26, took his life on Friday at his home in New York in the midst of a lengthy court battle that could have put him behind bars for decades. He was charged with computer fraud after copying 4.8 million scientific articles from the nonprofit journal archive JSTOR to allegedly redistribute online.

According to his defence lawyers, the Reddit co-founder killed himself shortly after learning that the prosecution would not consider a plea bargain that would rule out a jail sentence.

Within days of his death, an online petition was created urging President Obama to fire Ortiz after Swartz's family said their son's suicide was "the product of a criminal justice system rife with intimidation and prosecutorial overreach". The web appeal, hosted by the White House website, has collected at least 40,000 signatures.

Today, Ortiz, the US attorney for the district of Massachusetts, said her "office's conduct was appropriate in bringing and handling this case". She claimed that her team had not pushed for an unduly severe punishment.

"At no time did this office ever seek – or ever tell Mr Swartz’s attorneys that it intended to seek – maximum penalties under the law," she said in a statement.

"The prosecutors recognised that there was no evidence against Mr Swartz indicating that he committed his acts for personal financial gain, and they recognised that his conduct – while a violation of the law – did not warrant the severe punishments authorised by Congress and called for by the Sentencing Guidelines in appropriate cases.

"That is why in the discussions with his counsel about a resolution of the case this office sought an appropriate sentence that matched the alleged conduct – a sentence that we would recommend to the judge of six months in a low-security setting.

"While at the same time, his defence counsel would have been free to recommend a sentence of probation. Ultimately, any sentence imposed would have been up to the judge."

Swartz faced 13 felony charges including counts of wire fraud, computer fraud and recklessly damaging a protected computer, which could cumulatively carry a sentence of more than 30 years.

The federal attorney's statement, the first time she's been drawn to comment on Swartz's death, also offered her sympathies to his family and friends.

"I know that there is little I can say to abate the anger felt by those who believe that this office’s prosecution of Mr Swartz was unwarranted and somehow led to the tragic result of him taking his own life," she said. ®