It said Mursi had fainted after a court session and died afterwards.
"The court granted him his request to speak for five minutes... He fell to the ground in the cage... and was transported immediately to the hospital. A medical report found... no pulse or breathing," the office of the attorney general said in a statement.
"He arrived at the hospital dead at 4.50pm exactly and there were no new, visible injuries found on the body."
"He was speaking before the judge for 20 minutes then became very animated and fainted. He was quickly rushed to the hospital where he later died," a judicial source said.
One of Morsi's defence lawyers described the moment he received news of his death.
"We heard the banging on the glass cage from the rest of the other inmates and them screaming loudly that Morsi had died," the lawyer, Osama El Helw, told AFP.
"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.
Mursi, a top figure in the Muslim Brotherhood, was toppled by the military in 2013 after mass protests against this rule.
He had been serving a seven-year sentence for falsifying his candidacy application for the 2012 presidential race.
Since his overthrow on July 3, 2013, his former defence minister now President Abdel Fattah al-Sisi has waged an ongoing crackdown targeting his supporters from the Muslim Brotherhood with thousands jailed and hundreds facing death sentences.
The years following Morsi's overthrow have seen a surge in bombings and shootings targeting security forces, particularly in the restive northern Sinai Peninsula, a stronghold of the Islamic State group.
Erdogan pays tribute to 'martyr'
Turkish President Recep Tayyip Erdogan paid tribute to the former Egyptian president, calling him a "martyr."
"May Allah rest our Mursi brother, our martyr's soul in peace," said Erdogan, who had forged close ties with Mursi.
Qatar ruler expresses 'deep sorrow'
Qatar's ruler Sheikh Tamim bin Hamad Al-Thani also expressed his "deep sorrow" following the "sudden death".
"We received with deep sorrow the news of the sudden death of former president Dr Mohamed Mursi. I extend to his family and to the Egyptian people brotherly condolences," Al-Thani wrote on Twitter.
تلقينا ببالغ الأسى نبأ الوفاة المفاجئة للرئيس السابق الدكتور محمد مرسي .. أتقدم إلى عائلته وإلى الشعب المصري الشقيق بخالص العزاء.. إنا لله وإنا إليه راجعون
— تميم بن حمد (@TamimBinHamad) June 17, 2019
Muslim Brotherhood says Mursi death ‘full-fledged murder’
The Muslim Brotherhood said on Monday that the death of Mursi was a "full-fledged murder" and called on Egyptians to gather for a mass funeral.
In a statement on its website, the Brotherhood also called for crowds to gather outside Egyptian embassies around the world.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ