It is narrated from Sayyiduna Ali bin Abi Talib (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "Three things are among the foundations of the religion: offering the Friday prayer behind every righteous and wicked (imam or ruler), offering the funeral prayer for everyone of the people of the Qiblah who dies, and waging jihad under (Islamic) rule, whoever's rule it may be; your reward is assured for you."