Swartz, the co-founder of Reddit who was facing prosecution in the US for computer hacking, is believed to have committed suicide in New York City on Friday (January 11).
In its message, Anonymous accused the government of a "grotesque miscarriage of justice" over Swartz's prosecution for allegedly hacking the JSTOR academic journals database.
The message, which has been taken down but not before The Verge took a screengrab, said: "Whether or not the government contributed to his suicide, the government's prosecution of Swartz was a grotesque miscarriage of justice, a distorted and perverse shadow of the justice that Aaron died for."
Anonymous said that the case "highlights the injustice of US computer crime laws, particularly their punishment regimes, and the highly-questionable justice of pre-trial bargaining".
"Aaron's act was undoubtedly political activism; it had tragic consequences," the message added.
Freedom of information activist Swartz had been facing trial over allegations he hid a laptop in a maintenance closet at MIT to download a large quantity of academic papers hidden behind a paywall in the JSTOR database.
JSTOR later dropped its case against Swartz for releasing millions of the papers, but he was still indicted on federal charges under the Computer Fraud and Abuse Act.
Before his death in Brooklyn, Swartz had reportedly been denied further talks on his plea bargain by Assistant US Attorney Stephen Heymann. He was facing up to 35 years in prison if convicted.
Following the web hack, Anonymous said that it does not "consign blame or responsibility upon MIT for what has happened", and also apologised for using the university's websites to post the message.
MIT has said that it will launch an investigation into its role in the prosecution of Swartz and his tragic death.
In a statement yesterday, MIT president L. Rafael Reif said: "I want to express very clearly that I and all of us at MIT are extremely saddened by the death of this promising young man who touched the lives of so many.
"It pains me to think that MIT played any role in a series of events that have ended in tragedy."