JERUSALEM (Reuters) -The Israeli military said three soldiers had been killed in combat in southern Gaza on Wednesday, as it pressed ahead with its offensive in Rafah.

Three more soldiers were badly wounded in the same incident, the military said, though it provided no further details. Israel's public broadcaster Kan radio said they were injured by an explosive device set off in a building in Rafah.

Defying an order from the International Court of Justice, Israeli forces have kept up their offensive in Rafah, where they aim to root out the last major intact formations of Hamas fighters and rescue hostages.

International unease over Israel's three-week-old Rafah offensive has turned to outrage since an airstrike on Sunday set off a blaze in a tent camp in a western district of the city, killing at least 45 people.

Israel said it had been targeting two senior Hamas operatives and had not intended to cause civilian casualties. Prime Minister Benjamin Netanyahu said that "something unfortunately went tragically wrong".

The Israeli military said it was investigating the possibility that munitions stored near a compound targeted by Sunday's airstrike may have ignited.

Israel told around one million Palestinian civilians displaced by the almost eight-month-old war to evacuate from Rafah before launching its incursion in early May. Around that many have fled the city since then, according to the U.N. agency for Palestinian refugees, UNRWA.

On Tuesday, the United States, Israel's closest ally, reiterated its opposition to a major Israeli ground offensive in Rafah but said it did not believe such an operation was under way.

(Reporting by Maayan Lubell; Editing by Andrew Heavens and Kevin Liffey)