CAIRO — Ousted Egyptian president Mohammed Morsi has praised the Palestinian “resistance” over the 21-day conflict with Israel in Gaza.

The Islamist leader, overthrown last July by Egypt’s then army chief and now President Abdel-Fattah el-Sissi, is on trial on charges for which he faces the death penalty.

Under Morsi’s rule, Egypt brokered a truce in 2012 between Israel and Hamas, the Islamist movement that controls the Gaza Strip, after they fought a similar deadly war. Hamas is an offshoot of Morsi’s Muslim Brotherhood group.

“Our compass is set on supporting Palestine against the usurping occupier and we are with any resistance against any occupier,” Morsi said in a message posted on his official Facebook page late Sunday.

Terrorists in Gaza have sent over 2,000 missiles into the Jewish state during the conflict that has so far claimed 46 lives in Israel, including 43 soldiers. More than 1,030 people, among them hundreds of terror operatives, were killed in Israeli strikes during an ongoing operation to thwart rocket fire and expose underground terror tunnels.

“A full salute to those who resist and to the revolutionaries,” Morsi said in remarks marking the start of the Muslim holiday of Eid al-Fitr that ends the Muslim holy month of Ramadan.

Egypt’s new authorities have blacklisted Hamas and accused it of plotting attacks in the country.

Morsi himself and other Brotherhood leaders are accused of colluding with Hamas to sow chaos inside Egypt during the 2011 revolt that toppled former president Hosni Mubarak.

In his message, Morsi also hailed his supporters for “the pursuit of their revolution.”

Since Morsi’s ouster, his supporters have been staging regular protests calling for his reinstatement.

However, their rallies have sharply dwindled amid a government crackdown that has left more than 1,400 people dead and at least 15,000 detained.