The claim came during the second hearing of his trial on espionage charges.
Prosecutors allege that he and 35 others were involved in a plot to destabilise Egypt. The trial was later adjourned to 27 February.
The deposed Islamist leader is facing four separate trials.
Mr Morsi’s supporters say he and other senior Muslim Brotherhood leaders are the victims of politically motivated prosecutions.
The espionage trail opened on 16 February and on Sunday prosecutors detailed the charges against Mr Morsi and his co-defendants.
They were specifically accused of “delivering to a foreign country… national defence secrets and providing the Iranian Revolutionary Guards with security reports in order to destabilise the security and stability of the country”, AFP news agency reported.
The statement read in court did not identify the “foreign country”.
Mr Morsi is also accused of collaborating with the Palestinian movement Hamas and Lebanon’s Hezbollah movement. If convicted, he could receive the death penalty.
During Sunday’s hearing, Mr Morsi was held separately in a soundproof glass cage to prevent him shouting and disrupting proceedings.
Mr Morsi was ousted by the military last July following mass street protests against his government.
There has since been a severe crackdown on his Muslim Brotherhood group, as well as on other activists seen as hostile to the military-backed government.
The Brotherhood has been declared a terrorist organisation and authorities have punished any public show of support for it.
Other senior Brotherhood figures, including supreme guide Mohammed Badie and his deputy and former presidential candidate Khairat al-Shater, are also facing a raft of charges.
Proceedings in two other trials have already begun.
The first opened in November, with Mr Morsi facing charges of inciting the killing of protesters near the presidential palace when he was in office in 2012.
In January, another trial opened concerning his escape from prison in a jailbreak in 2011, during which police officers were killed.
The fourth trial, which has yet to open, will be on charges of insulting the judiciary.