His body was taken to a hospital, it said.
The Associated Press reported this story.
In April 2012, Morsi entered the presidential campaign as the Muslim Brotherhood candidate.
The Detention Review Panel, commissioned by Mr Morsi's family, said he was "receiving inadequate medical care, particularly inadequate management of his diabetes, and inadequate management of his liver disease". Rights groups say its poor conditions fall far below Egyptian and worldwide standards. Human rights groups have documented dozens of cases of torture.
Morsi was a longtime senior figure in Egypt's most powerful Islamist group, the Muslim Brotherhood.
In November 2013, Morsi faced trial along with14 other brotherhood members.
The general who led efforts to remove Morsi from power, Abdel-Fattah el-Sissi, went on to become elected president in 2014 and won his second term after a largely uncontested vote a year ago.
Sarah Leah Whitson, Human Rights Watch Middle East director, tweeted: "This is awful but ENTIRELY predictable, given government failure to allow him adequate medical care".
The prosecutor's statement said Morsi addressed the court for five minutes before it went into recess.
A British member of Parliament, Crispin Blunt, who had led a delegation of United Kingdom lawmakers and lawyers a year ago in putting out a report on Mursi's detention, slammed the conditions of Mursi's incarceration.
Security sources said the Interior Ministry had declared a state of alert on Monday, notably in Sharqiya. Morsi was a civil engineer with a doctorate from the University of Southern California. Massive protests grew against their rule.
The subsequent crackdown has all but completely dismantled the Brotherhood, with hundreds killed and thousands imprisoned, with most other active figures fleeing overseas.
"I saw him from afar wheeled out on the stretcher from the courts complex" from Tora, in southern Cairo, said another one of his lawyers, Abdelmoneim Abdel-Maksoud.