- Massacre toll rises to 28,340; 67,984 wounded
- Prospect of an attack on Rafah terrifying: UN
The mission by the Israeli military, the Shin Bet security service and a special police unit, freed Fernando Simon Marman, 60, and Louis Hare, 70, the military said.
Much of the densely-populated strip of land on the Mediterranean is in ruins, with 28,340 Palestinians dead and 67,984 wounded, according to Gaza health officials, with many others believed to be buried under rubble.
US President Joe Biden, who has become increasingly vocal that Israel should not carry out a ground offensive in Rafah without a plan to protect civilians, is scheduled to meet Jordan's King Abdullah, who has been on a diplomatic tour of western capitals to push for a ceasefire.
An Israeli military spokesman said the hostages were being held on the second floor of a building that was breached with explosives during the raid amid heavy exchanges of gunfire with surrounding buildings.
People in Rafah said two mosques and several residential buildings were hit in more than an hour of strikes by Israeli warplanes, tanks and ships, which also ripped through tents where people had taken shelter.
Some Palestinians feared Israel had begun a long-expected ground offensive in the city, where people displaced by the war are sheltering with nowhere else to go.
UN human rights chief Volker Turk called the prospect of an attack on Rafah "terrifying".
"Those with influence must restrain, rather than enable," he said in a statement.
Many Western leaders have expressed alarm at Israel's offensive while continuing to support the country.
Britain urged Israel to agree to a truce to free its hostages rather than attack Rafah where people were trapped.
An Israeli official has said people will be evacuated further north, but its forces are also active in central Gaza.