Palestinian security officials escorted the four — a South Korean journalist, two French citizens and a Canadian — into the headquarters of the Palestinian preventive security agency in Gaza City. Security officials had worked through the night to secure their release.
Palestinian gunmen originally seized 11 foreigners after Tuesday's raid in the West Bank town of Jericho. Most of the hostages were quickly released unharmed.
In the raid, Israel seized six wanted Palestinians, including the mastermind of the 2001 assassination of an Israeli Cabinet minister.
Officials at the South Korean Embassy in Tel Aviv said they had recently cautioned citizens against traveling to Gaza.