Egyptian President Hosni Mubarak warned Israel on Tuesday that history shows no occupation lasts forever. "Your people's security cannot be attained by exercising a policy of collective punishment, aggression, siege, walls and building settlements," he said in comments broadcast live on state television. Mubarak added that for their part, the Palestinians needed to unify their ranks and consider their actions for the sake of their suffering children. "Resistance is a legitimate right for any people under occupation, but it should be examined according to the principle of profit and loss... Give peace a chance and don't give excuses to those who want to derail its march." In a speech in honor of the Prophet Muhammad's birthday, Mubarak said continued insults to the prophet would just make the situation worse for everyone, while at the same time criticizing the extremists using these insults to justify their actions. "With the Prophet's birthday anniversary, the falsifications and insults have surfaced again hiding behind the freedom of expression and the press," he said in comments broadcast live on state television. "We tell them it is enough now talking about the dialogue between cultures, civilizations and religions and be aware of following the path that will take you and us into a dangerous abyss." The Egyptian president did not say who his remarks were directed at, but they came amid renewed controversy over the reprinting by Western newspapers of a Danish cartoon deemed insulting to the prophet to show their commitment to freedom of speech. Mubarak also accused Islamic extremists of acting contrary to Islam's teachings of moderation and hurting its reputation to outsiders. "We tell ourselves, truly and frankly, that there are some people among us who harmed Islam before non-Muslims did. Those who are among us ignored the moderation and forgiveness of Islam, distorted its image and gave excuses to those who harmed it by connecting it to extremism, terrorism and backwardness," Mubarak said.