Germany on Monday called on all parties to continue with negotiations towards a truce in Gaza after disagreements between Israel and Hamas appeared to intensify at weekend talks in Cairo.

Israel ordered the evacuation of Palestinians from eastern Rafah earlier Monday, following stalled talks between Israel and Hamas in Cairo over the Islamist group's demands to end the seven-month war.

The evacuation announcement came ahead of a long-threatened ground invasion of the southern Gaza city, which triggered widespread global alarm.

"The negotiations must not be jeopardised and all sides must make maximum efforts to ensure that the people in Gaza are supplied with humanitarian goods... and that the hostages are freed," a foreign ministry spokeswoman told a government press briefing.

On Sunday, four Israeli soldiers were killed and others wounded, the army said, when a barrage of rockets was fired towards the Kerem Shalom border crossing between Israel and Gaza.

The armed wing of Palestinian militant group Hamas has claimed the rocket attack, which led Israeli authorities to close the crossing, used to deliver aid into Gaza.

German Foreign Minister Annalena Baerbock said the attack had shown the "true face" of Hamas.

"The shelling of one of the most important access points for humanitarian aid shows once again that the terrorists of Hamas do not care about the humanitarian needs of the people in Gaza," Baerbock told journalists on a trip to Fiji on Monday.

Baerbock said Germany has been doing "everything we can for months to finally alleviate the immeasurable suffering of the people in Gaza".

Germany also on Monday criticised Israel's decision to bar Qatar-based news channel Al Jazeera and called for the protection of press freedom.

"A free and diverse press landscape is an important cornerstone of any liberal democracy," the foreign ministry wrote on X, formerly Twitter, adding that the move "sends the wrong signal".