Egypt’s former president Mohamed Morsi was buried before dawn on Tuesday, hours after he collapsed during a court appearance and died. Morsi was buried at a suburban Cairo cemetery dedicated to senior members of the Muslim Brotherhood, an Islamist group outlawed and declared a terrorist organization soon after the military removed and detained him in 2012 amid mass protests against his divisive, one-year rule. His wife, children and a family lawyer attended the burial that took place amid tight security between 2 am and 4 am after the family attended a traditional funeral prayer held at the mosque of the prison complex at a southern Cairo suburb where he had been held. Morsi’s grave sits near to that of the Brotherhood’s late spiritual leader Mahdi Akef who died in prison in 2017. The former president’s dramatic death, collapsing shortly after he addressed the court for five minutes, signals the demise of the most potent symbol of Brotherhood rule in Egypt, an era whose legacy continues to divide many Egyptians to this day. Ironically, Morsi's polarizing legacy is defined by contrast. He became Egypt's first freely elected president a year after a 2011 popular uprising seeking democracy and social equality toppled the autocratic, 29-year rule of Hosni Mubarak. Only months after his election, however, he showed his and the Brotherhood's authoritarian tendencies by decreeing that he gets far-reaching powers and be above judicial oversight. Perhaps more importantly, during his year in office Morsi failed to cast aside his blind loyalty to the Brotherhood and become a leader for all Egyptians. He also failed to restore stability to a country then mired in the political turmoil and violence following the 2011 uprising. That mixed legacy has been reflected in a debate now raging on social media about whether Morsi, who along with the Brotherhood has for years been demonized by the state media, deserved the traditional prayer of "May God have mercy on him" that Muslims usually repeat when someone passes away, often regardless of the deceased's track record. One camp is adamant that Morsi does not deserve the prayer since he and his Brotherhood are blamed for deadly attacks against security forces and civilians after his removal in 2013. They also cite instances when their supporters publicly gloated over the death of police and troops at the hands of Islamic militants. The opposing camp maintains that Morsi' death places him in the hands of God, the best judge of all, and that everyone is deserving of a prayer for mercy. In Tuesday’s now government-controlled newspapers across Egypt, Morsi's death was only briefly reported. By contrast, in Turkey, mosques across the Muslim nation held funeral prayers for Morsi, who had close ties to Turkish President Recep Tayyip Erdogan. His death was also mourned by a main Syrian opposition group, the Turkey-based Syrian National Coalition, recalling the Egyptian's early support for the rebels who rose up against President Bashar Al Assad's government in 2011. On Monday afternoon, Morsi collapsed while inside the defendants' soundproof, iron-and-glass cage at a courtroom inside a police academy in southern Cairo. The academy is adjacent to the Torah prisons complex that houses the maximum security facility nicknamed The Scorpion. He was held at that facility while facing multiple court cases on charges ranging from espionage to breaking out of Jail during the 2011 uprising. A statement by Egypt's chief prosecutor said he addressed the court for five minutes before he collapsed. He was announced dead on arrival at a prison hospital. In his final comments, according to his lawyer, the former president repeated his assertion that he was still the country's legitimate leader and that he should be tried before a special tribunal. He also claimed to be privy to secrets that, if he revealed, would secure his innocence but endanger national security. His comments came while the court trying him for spying for and conspiring with the militant Palestinian group Hamas was in recess. The military, then led by the now president Abdel Fattah El Sisi, removed Morsi amid mass rallies against his rule. Since then, authorities have detained thousands of Brotherhood supporters in a major crackdown as they seek to remove the group from positions of power or influence. The month after he was removed, security forces moved to break up two sit-in encampments by his supporters at opposite ends of Cairo, killing more than 600 of them in one day. One of Morsi's sons, Osama, is serving a 10-year sentence in a case related to the 2013 sit-ins but was allowed out to attend his father's burial. Morsi long suffered from diabetes and his family has previously complained that poor prison conditions were impacting his health. Egypt's State Information Service on Tuesday dismissed accusations he was denied medical visits as "nothing but false claims".