El-Haiwan, a university professor and doctor, was tried on charges of possessing weapons and plotting to use them during Egypt's parliamentary elections in November and December last year.
A state security court ordered he be released in June, but el-Haiwan remained in custody. He was released in October, but a few days later el-Haiwan was re-arrested. The court again ordered his release on Sunday.
Thousands attend el-Haiwan's funeral Sunday in the Sharqiyya Province, northeast of Cairo.
Hundreds of Muslim Brotherhood members have been detained since the elections in a new crackdown on the banned group. In June, police detained about 220 members who were attending a protest in support of el-Haiwan.
The Muslim Brotherhood increased its seats in parliament sevenfold in last year's legislative elections. The Brotherhood, which holds 88 seats in parliament is Egypt's largest Islamist group.
Founded in 1928, the Brotherhood has been banned since 1954, though it renounced violence in the 1970s. It is not allowed to run as a party in the elections, but it endorses “independent” candidates who openly declare their allegiance to the group.