CAIRO -- Officials say prosecutors will investigate allegations that Egypt's ousted president escaped from prison during the 2011 revolution with help from the Palestinian militant group Hamas.

The officials say chief prosecutor Hesham Barakat has collected testimonies from a court in the Suez Canal city of Ismailia that will be the base for an investigation by state security prosecutors into the jailbreak by Mohammed Morsi and more than 30 other Muslim Brotherhood leaders.

The question of whether Hamas helped them escape amid the chaos surrounding the uprising that toppled Hosni Mubarak has been debated in the media for months.

Hamas denied any role. Morsi says local residents helped him escape.

The officials spoke on condition of anonymity because they were not authorized to speak to the media.

Earlier on HuffPost:

Loading Slideshow...
  • Egyptian protesters chant pro-Morsi slogans as they gather in front of the parliament building in Cairo, Egypt, Tuesday, July 10, 2012. (AP Photo/Khalil Hamra)

  • Opponents of Egypt's Islamist President Mohammed Morsi shout slogans during a protest in Tahrir Square in Cairo, Egypt, Wednesday, July 3, 2013. (AP Photo/Amr Nabil)

  • An injured protester reacts during clashes between residents and Muslim Brotherhood members and Egyptian President Mohamed Morsi supporters outside Cairo University, on July 3, 2013 in Cairo. (MOHAMED EL-SHAHED/AFP/Getty Images)

  • A member of Egyptian police special forces stands guard beside an armored vehicle, protecting a bridge between Tahrir Square and Cairo University, where Muslim Brotherhood supporters have gathered, in Giza, Egypt, Wednesday, July 3, 2013. (AP Photo/ Manu Brabo)

  • A protester runs past a fire raging during clashes in Giza, Egypt, early Wednesday, July 3, 2013. (AP Photo/Nameer Galal)

  • Egyptian protesters calling for the ouster of President Mohamed Morsi react as they watch his speech on a screen in a street leading to presidential palace early in Cairo on July 3, 2013. (MAHMUD KHALED/AFP/Getty Images)

  • A car burns during clashes between residents and Muslim Brotherhood members and Egyptian President Mohamed Morsi supporters outside Cairo University, on July 3, 2013 in Cairo. (MOHAMED EL-SHAHED/AFP/Getty Images)

  • An Egyptian opposition protester holds a chair and knife during a clash between supporters and opponents of President Mohammed Morsi in downtown Damietta, Egypt, Wednesday, July 3, 2013. (AP Photo/Hamada Elrasam)

  • Thousands of Egyptian protesters begin to gather in Tahrir Square as the deadline given by the military to Egyptian President Mohammed Morsi approaches on July 3, 2013 in Cairo, Egypt. (Spencer Platt/Getty Images)

  • An opposition demonstrator sits below graffiti of Egyptian President Mohammed Morsi on the walls of Egypt's Presidential Palace in the suburb of Heliopolis on July 3 2013, in Cairo, Egypt. (Ed Giles/Getty Images).

  • Opponents of Egypt's Islamist President Mohammed Morsi light flares in Tahrir Square in Cairo, Egypt, Tuesday, July 2, 2013. (AP Photo/Amr Nabil)

  • This image made from video broadcast on Egyptian State Television shows President Mohammed Morsi addressing the nation in a televised speech on Tuesday, July 2, 2013. (AP Photo/Egyptian State Television)

  • Opponents of Egyptian Islamist President Mohammed Morsi protesters shout slogans in Tahrir Square in Cairo, Egypt, Tuesday, July 2, 2013. (AP Photo/Amr Nabil)

  • An Egyptian protester cries during a demonstration supporting Egypt's Islamist President Mohammed Morsi near Cairo University in Giza, Egypt, Tuesday, July 2, 2013. (AP Photo/Manu Brabo)

  • Opponents of Egypt's Islamist President Mohammed Morsi shout slogans during a protest in Tahrir Square in Cairo, Egypt, Wednesday, July 3, 2013. (AP Photo/Amr Nabil)

  • Egyptian protesters calling for the ouster of President Mohamed Morsi react as they watch his speech on a screen in a street leading to presidential palace early in Cairo on July 3, 2013. (MAHMUD KHALED/AFP/Getty Images)

  • Egyptian military army soldiers stand guard at the entrance of the presidential palace, in Cairo, Egypt, Tuesday, July 2, 2013. (AP Photo/Khalil Hamra)

  • Opponents of Egypt's Islamist President Mohammed Morsi bang drums during a protest outside the presidential palace, in Cairo, Egypt, Tuesday, July 2, 2013. (AP Photo/Khalil Hamra)

  • Fireworks light the sky as opponents of Egypt's Islamist leader Mohammed Morsi celebrate outside the presidential palace in Cairo, Egypt, Wednesday, July 3, 2013. (AP Photo/Khalil Hamra)

  • Supporters of Egypt's Islamist President Mohammed Morsi chant slogans during a rally, in Nasser City, Cairo, Egypt, Wednesday, July 3, 2013. (AP Photo/Hassan Ammar)

  • A military helicopter files over the presidential palace as opponents of Egypt's Islamist President Mohammed Morsi celebrate, in Cairo, Egypt, Wednesday, July 3, 2013. (AP Photo/Khalil Hamra)

  • Egyptian police evacuate an injured Salafi man during clashes in front of the Culture Ministry in Cairo, Egypt, Tuesday, June 11, 2013. (AP Photo/Khalil Hamra)

  • Egyptian riot police try to separate Salafis and protesters during clashes in front of the Culture Ministry in Cairo, Egypt, Tuesday, June 11, 2013. (AP Photo/Khalil Hamra)

  • Supporters of Egypt's military shout anti-Muslim Brotherhood slogans during a protest in front of the Unknown Soldier memorial in Cairo, Egypt, Friday, March 15, 2013. (AP Photo/Amr Nabil)

  • Egyptian masked protesters, who call themselves the black eagles and describes themselves as peaceful but are prepared to defend any attacks against protesters, gather near the presidential palace in Cairo, Egypt, Friday, Jan. 25, 2013. (AP Photo/Amr Nabil)

  • Egyptian protesters take cover as they clash with riot police, not seen, near Tahrir Square, Cairo, Egypt, Friday, Jan. 25, 2013. (AP Photo/Khalil Hamra)

  • An Egyptian protester runs for cover from tear gas fired by riot police, not seen, during clashes near Tahrir Square, Cairo, Egypt, Friday, Jan. 25, 2013. (AP Photo/Khalil Hamra)

  • Egyptian protesters clash with riot police, not seen, near Tahrir Square, Cairo, Egypt, Friday, Jan. 25, 2013. (AP Photo/Khalil Hamra)