RAFAH, GAZA STRIP -- Two months ago, before Israeli troops invaded Rafah, the city sheltered most of Gaza's more than two million people. Today it is a dust-covered ghost town.

Abandoned, bullet-ridden apartment buildings have blasted out walls and shattered windows. Bedrooms and kitchens are visible from roads dotted with rubble piles that tower over the Israeli military vehicles passing by. Very few civilians remain.

Israel says it has nearly defeated Hamas forces in Rafah 鈥 an area identified earlier this year as the militant group's' last stronghold in Gaza.

The Israeli military invited reporters into Rafah on Wednesday, the first time international media visited Gaza's southernmost city since it was invaded May 6. Israel has barred international journalists from entering Gaza independently since the Hamas attack on Oct. 7 that sparked the war.

Before invading Rafah, Israel said Hamas' four remaining battalions had retreated there, an area of about 25 square miles (65 square kilometres) that borders Egypt. Israel says hundreds of militants have been killed in its Rafah offensive. Scores of women and children have also died from Israeli airstrikes and ground operations.

The military says it has been necessary to operate with such intensity because Hamas turned civilian areas into treacherous traps. Eight soldiers were killed last month by a single blast.

鈥淪ome of these tunnels are booby-trapped,鈥 the military's chief spokesman, Rear Adm. Daniel Hagari, said during Wednesday's tour as he stood over a shaft that led underground. 鈥淗amas built everything in a civilian neighborhood among houses, among mosques, among the population, in order to create its terror ecosystem.鈥

An estimated 1.4 million Palestinians crammed into Rafah after fleeing fighting elsewhere in Gaza. The UN estimates that around 50,000 remain in Rafah, which had a pre-war population of about 275,000.

Most have moved to a nearby Israel-declared 鈥渉umanitarian area鈥 where conditions are grave. Many are clustering in squalid tent camps along the beach with scant access to clean water, food, bathrooms and medical care.

Efforts to bring aid into southern Gaza have stalled. Israel's incursion into Rafah closed down one of two major crossings into the south of Gaza. The UN says little aid can enter from the other main crossing 鈥 Kerem Shalom 鈥 because the route is too dangerous and convoys are vulnerable to attacks by armed groups searching for smuggled-in cigarettes.

On Wednesday, a line of trucks on the Gaza side of Kerem Shalom was visible, but the trucks were hardly moving 鈥 a sign of how Israel's pledge to keep the route safe in order to facilitate the delivery of aid inside Gaza has fallen flat.

UN officials say some commercial trucks have braved the route into Rafah, but not without hired armed guards riding atop their convoys.

Israel says it is close to dismantling the group as an organized military force in Rafah. In a reflection of that confidence, soldiers brought journalists in open-air military vehicles down the road that leads into the heart of the city.

Along the way, debris lying by the side of the road made clear the perils of aid delivery: carcasses of trucks lying baking in the hot sun; dashboards covered in fencing meant to protect drivers; aid pallets lying empty.

The longer the aid delivery is frozen, humanitarian groups say, the closer Gaza comes to running out of fuel, which is needed for hospitals, water desalination plants and vehicles.

鈥淭he hospitals are once again short on fuel, risking disruption of critical services,鈥 said Dr. Hanan Balkhy, the World Health Organization鈥檚 regional director for the Eastern Mediterranean. "Injured people are dying because the ambulance services are facing delays due to fuel shortages.鈥

As the humanitarian situation worsens, Israel is pushing ahead with its offensive. Combat in Rafah is ongoing.

After journalists heard nearby gunshots on Wednesday, the soldiers told the group they would not be visiting the beach, as had been planned.

The group departed the city soon after, with clouds of dust kicked up by vehicles temporarily obscuring the mass of destruction behind them.

Associated Press reporter Julia Frankel contributed from Jerusalem.