Security forces have been accused of murdering Egypt’s former president Mohamed Morsi after friends and colleagues say police failed to administer first aid fast enough when he collapsed during a hearing in Cairo on Monday.

Prison guards allegedly left the 67-year-old Muslim Brotherhood leader “slumped on the floor” of his courtroom cage for more than 20 minutes, despite other defendants calling for help.

Morsi, who was suffering from diabetes, hypertension and liver disease, had collapsed after speaking during a retrial hearing on charges of collaborating with foreign powers and militant groups.

The Egyptian attorney-general’s office denied the claims, saying he “was transported immediately to the hospital” where he was later pronounced dead. He is believed to have died from a heart attack.

The United Nations and rights groups have called for an independent investigation into the detention conditions and death of the Islamist.

The country’s first democratically elected president, who was ousted from power in 2013, was buried hastily in Nasr City, an eastern suburb of the capital – against the wishes of his family who requested he be laid to rest in his home governorate of Sharqiya.

Only a handful of family members and lawyers were permitted to be present at the burial but were not given access to an autopsy report.

In pictures: Egypt protests on Arab Spring anniversary Show all 11 1 /11 In pictures: Egypt protests on Arab Spring anniversary In pictures: Egypt protests on Arab Spring anniversary Cairo anniversary protests A supporter of Egyptian President Abdel Fattah al-Sisi waves his national flag during a demonstration in Cairo on January 25, 2015 AFP In pictures: Egypt protests on Arab Spring anniversary Cairo anniversary protests A riot police officer holds a weapon during an anti-government protest in downtown Cairo January 25, 2015 Reuters In pictures: Egypt protests on Arab Spring anniversary Cairo anniversary protests An anti-government shouts slogans against the military and interior ministry during a protest in front of the journalists' syndicate in Cairo January 25, 2015 Reuters In pictures: Egypt protests on Arab Spring anniversary Cairo anniversary protests Anti-government protesters shout as they call out to others with them to walk into Tahrir square after they clashed briefly with pro-government protesters, in Cairo January 25, 2015 Reuters In pictures: Egypt protests on Arab Spring anniversary Cairo anniversary protests Anti-government protesters help an injured protester when pro-government protesters threw stones during a protest in front of the press syndicate in Cairo January 25, 2015 Reuters In pictures: Egypt protests on Arab Spring anniversary Cairo anniversary protests An Egyptian is arrested by plainclothes police in downtown Cairo, Egypt, Sunday, Jan. 25, 2015 AP In pictures: Egypt protests on Arab Spring anniversary Cairo anniversary protests Egyptian security forces deploy in the Cairo suburb of Matariyah, Egypt, Sunday, Jan. 25, 2015 AP In pictures: Egypt protests on Arab Spring anniversary Cairo anniversary protests A woman mourns during the funeral of Shaima al-Sabbagh, Alexandria, Egypt, 25 January 2015 EPA In pictures: Egypt protests on Arab Spring anniversary Cairo anniversary protests Two supports of ousted President Mohamed Morsi in front of security forces near Tahrir Square in Cairo (AFP) In pictures: Egypt protests on Arab Spring anniversary Cairo anniversary protests Egyptian policemen detain a supporter of the People's Alliance Party during a demonstration in Cairo's Talaat Harb square, near Tahrir square, on January 24, 2015 (AFP) In pictures: Egypt protests on Arab Spring anniversary Cairo anniversary protests People carry the coffin of Shaima al-Sabbagh during her funeral, Alexandria, Egypt, 25 January 2015 EPA

Abdullah al-Haddad, whose father and brother were standing trial alongside Morsi on Monday, said witnesses told him “no one bothered” to help when Morsi collapsed.

“He was left slumped for while till the guards took him out. An ambulance arrived after 30 minutes. Other detainees were first to notice his collapse, they started shouting. Some of them, who are doctors, asked the guards to let them treat him or give him first aid,” Mr Haddad told The Independent.

“Neglecting him at the beginning was deliberate. The first thing the prison guards did after detainees started shouting was to get family members out of the courtroom.” he added.

He said he now feared for his father, who he said had been denied heart surgery despite suffering from four heart attacks since his arrest.

His report was corroborated by a family friend of the defendants who spoke to Morsi’s relatives and the defendants after the trial, but asked to remain anonymous for security reasons.

“About 10 minutes after [Morsi] had stopped speaking, the people inside the cage started banging on the walls of the cage saying he is unconscious and they need help,” the activist told The Independent.

“The families who were there told me the police didn’t do anything for more than 20 minutes despite the yelling. They left him there.

“The police then started taking the families out of the court and the ambulance came.”

This testimony was also supported by Amr Darrag, who served as Morsi’s minister of international cooperation before the military takeover in 2013.

He told The Independent the former president was left unconscious on the floor of his cage for up to half an hour, adding that Morsi had not received proper medical treatment in detention.

“Fewer than 10 people were permitted to attend his funeral. There was no independent examination of his body,” Mr Darrag added speaking from Turkey.

The Egyptian foreign ministry did not immediately respond to The Independent’s request for comment on the accusations.

According to the official description of events, Morsi was transported immediately to the hospital after he collapsed.

The Egyptian State Information Service (SIS) issued a separate statement refuting reports Morsi was poorly treated behind bars, saying that calls for access to medical care had been approved by the court.

The SIS also accused rights groups of “circulating lies” amid growing calls for an immediate and independent investigation into what happened.

Human Rights Watch has called the death “terrible, but predictable” and has said family members had reported that he was forced to sleep on the floor of his squalid cell in Tora prison and suffered diabetic comas due to lack of medical attention.

Last year a group of British MPs and lawyers issued a damning report warning that Morsi could die in prison if he did not receive urgent medical care.

The British panel, headed by Crispin Blunt, the former chair of the Foreign Affairs Committee, and several London rights lawyers, concluded the former president was likely to have been subjected to torture, as he was being held for 23 hours a day in a bare concrete solitary confinement cell.

Morsi was elected in the summer of 2012, after beating Ahmed Shafik, the last prime minister of the toppled president Hosni Mubarak.

He was ousted from power by the military just a year later after nationwide protests against his rule. In July 2013 he was arrested and disappeared for five months.

During that period the army launched a brutal crackdown on Brotherhood, supporters killing hundreds of people and jailing tens of thousands more.

Morsi did not reappear until November 2013, when he stood trial for inciting violence against protesters, breaking free from jail in 2011 and espionage.

There was little reaction to news of his death in Cairo. But in Istanbul thousands of his supporters gathered in prayer, called by Turkey’s religious authority Diyanetl​