The Palestinian Hamas terror organization rushed Monday to claim that it had accepted a ceasefire — just hours after Israel warned residents of Rafah, the last Hamas stronghold in Gaza, to evacuate due to an imminent invasion.

International media reported Monday evening local time that Hamas had suddenly declared that it had accepted the Egyptian and Qatari terms for a temporary ceasefire, after holding out for weeks against agreeing to a deal with Israel.

But Israeli officials reportedly said that Hamas was “agreeing” to terms that Israel had not proposed or accepted.

The sudden urgency may have had everything to do with Israel’s pending attack, as thousands of Palestinian civilians began leaving Rafah, a strategic town on the Egyptian border and the last place in Gaza Israel has not fully entered.

As Breitbart News reported earlier Monday, Israel dropped leaflets on Rafah and used text messages, phone calls, and other method to warn residents to escape to the Al-Mawasi humanitarian zone at the coast and other places nearby.

An Israeli government spokesman, asked whether the warnings were a bluff designed to pressure Hamas to accept a deal, suggested that the invasion plans were very real, and were what Israel had promised to do for several months.

Hamas, suddenly facing its final destruction, appears to be much more eager to real a deal — if one is still possible.

The sticking point in previous negotiations was Israel’s insistence on destroying Hamas militarily and politically so that it cannot return to power in Gaza again. Hamas wanted Israel to commit to ending the war in any hostage deal.

Now, with Israel showing that it is willing to attack Hamas even before the hostages are released, Hamas leaders may be focused on self-preservation. It remains to be seen whether a true ceasefire agreement can actually be reached.

Joel B. Pollak is Senior Editor-at-Large at Breitbart News and the host of Breitbart News Sunday on Sirius XM Patriot on Sunday evenings from 7 p.m. to 10 p.m. ET (4 p.m. to 7 p.m. PT). He is the author of the recent e-book, “The Zionist Conspiracy (and how to join it),” now available on Audible. He is also the author of the e-book, Neither Free nor Fair: The 2020 U.S. Presidential Election. He is a winner of the 2018 Robert Novak Journalism Alumni Fellowship. Follow him on Twitter at @joelpollak.

Photo: file