CAIRO — Former leader of Egypt’s outlawed Muslim Brotherhood group Mahdi Akef, who had been detained since 2013, has died of complications from cancer and other health issues at age 89, a Brotherhood spokesman said Friday.

Talaat Fahmy said Akef’s family had requested he be released from custody because of his medical condition but the request was declined by an Egyptian court. He said Akef had cancer, heart problems and a broken thigh.

“The Egyptian court has refused to release him and he died of intentional medical negligence,” Fahmy told The Associated Press. mm

Akef, who headed the Brotherhood from 2004 to 2010, was among hundreds of the group’s figures arrested in the heavy crackdown launched against it following the military’s 2013 ouster of President Mohammed Morsi, a Brotherhood member.

Akef was initially convicted on violence-related charges and was sentenced to life imprisonment. The verdict was overturned on appeal, and he was facing a retrial.

The Brotherhood rose to power in elections following the 2011 uprising that ousted President Hosni Mubarak. But the military toppled the group after widespread protests against it.

A physical education school teacher, Akef joined the Muslim Brotherhood in 1940 and was part of the armed wing of the group, known as the Special Apparatus. The group carried out a series of assassinations and attacks against targets of British occupation in the country.

The group was accused of targeting President Gamal Abdel-Nasser in a failed assassination attempt, setting the stage for a heavy security crackdown and Akef was imprisoned from 1954 till 1974.

After his release, Nasser’s successor, Anwar Sadat, embraced the Muslim Brotherhood and Akef was appointed to a government post.

As relations between Egyptian leaders and the Brotherhood fluctuated, Akef rose through the Brotherhood’s ranks, eventually ascending to the group’s top post in 2004. A year later, the Brotherhood participated in the country’s parliamentary elections, winning 20 percent of the seats.

After Mubarak’s ouster, the group won all of Egypt’s elections, parliamentary and presidential, giving it a rare moment of triumph that quickly ended with Morsi’s ouster.

Hamas, Gaza’s ruling Palestinian group, expressed condolences on a Twitter posting and described Akef’s death as “the nation’s loss and one of its most prominent figures.” Hamas originated from the Muslim Brotherhood.