DEIR AL-BALAH, Gaza Strip — Israeli forces pressed their offensive against Hamas in northern Gaza on Monday, battling militia fighters around a hospital where thousands of patients and displaced people have been sheltering for weeks, and where health officials began planning the possible evacuation of dozens of wounded.

A medical worker inside the facility and the Health Ministry in Hamas-run Gaza said a shell struck the second floor of the Indonesian Hospital, killing 12 people. Both blamed Israel, which denied shelling the hospital, saying its troops returned fire on gunmen who targeted them from inside the 3.5-acre compound.

The advance came as 28 premature babies evacuated from Gaza City’s Shifa Hospital by the World Health Organization were transported to Egypt on Monday. Three others were transferred to an Emirati-run hospital in Rafah in southern Gaza, the Red Crescent said. More than 250 critically ill or wounded patients remain stranded at the compound that Israeli forces stormed days ago.

Gaza’s hospitals play a prominent role in the battle of narratives over the war’s brutal toll on Palestinian civilians, thousands of whom have been killed or buried in rubble since the conflict was sparked by Hamas’ Oct. 7 rampage into southern Israel. In the wake of the assault, Israeli leaders vowed to eradicate Hamas, destroy its ability to rule Gaza and uproot its militant infrastructure.

Israel says Hamas uses civilians as human shields and that it operated a major command hub inside and beneath Shifa, a claim hospital officials and Hamas deny. Critics say Israel’s siege and relentless bombardment amount to collective punishment of the territory’s 2.3 million Palestinians.

Israeli troops were battling Hamas fighters in the Jabaliya refugee camp, a densely built-up district on Gaza City’s northeastern side that has been heavily hit by bombardment for weeks. The military said that after moving through the center of the city to Shifa, its forces were now working to uproot Hamas fighters from eastern areas.

Dozens of dead and wounded in airstrikes and shelling overnight flowed into the Indonesian Hospital, near Jabaliya, said Marwan Abdallah, a medical worker there. He said Israeli tanks were operating less than 200 yards away, and Israeli snipers could be seen on the roofs of nearby buildings. As he spoke on the phone, the sound of gunfire could be heard in the background.

Health Ministry spokesperson Ashraf al-Qidra said some 600 patients, 200 health care workers and 2,000 displaced people are sheltering at the hospital. Al-Qidra said the International Committee for the Red Cross and the WHO evacuated 200 patients and their companions late Monday. Many of the injured evacuees are being treated at al-Nasser hospital in Khan Younis, he said.

In a separate development that could relieve some of the pressure on Gaza’s collapsing health system, dozens of trucks entered from Egypt on Monday with equipment from Jordan to set up a field hospital. Jordan’s state-run media said the hospital in the southern town of Khan Younis would be up and running within 48 hours.

After the evacuation of the premature babies and other wounded from Shifa, more than 250 patients with severely infected wounds and other urgent conditions remained in the hospital complex, which can no longer provide most treatment after it ran out of water, medical supplies and fuel for emergency generators.

Israel’s army said it has evidence that Hamas maintained a sprawling command post inside and under the hospital’s 20-acre complex, which includes several buildings.

On Sunday, the military released a video showing what it said was a tunnel discovered at the hospital, 60 yards long and about 33 feet below ground. It said the tunnel ended at a blast-proof door with a hole in it for gunmen to fire out of. Troops have not opened the door yet, it said. The Associated Press was not able to independently confirm the military’s findings.

Hamas and hospital staff have denied the allegations of a command post under Shifa.

Strikes in the Nuseirat and Bureij refugee camps Monday killed at least 40 people, according to hospital officials, and residents said dozens more were buried in the rubble.

More than 12,700 Palestinians, including more than 5,000 minors and 3,250 women, have been killed in Gaza, according to the Palestinian Health Ministry in the West Bank said Monday, which coordinates with officials in the Health Ministry of Hamas-run Gaza. Officials there say another 4,000 are missing and believed buried in rubble.

Violence has also surged in the Israeli-occupied West Bank, where attacks by Jewish settlers are on the rise and where more than 200 Palestinians have been killed since the start of the war, mostly in battles triggered by Israeli military raids.

About 1,200 people have been killed on the Israeli side, mainly civilians during the Oct. 7 attack.