Five artillery shells hit the children's ward of a Sri Lankan hospital, killing at least nine and injuring 20, according to aid agencies, as the army and rebels continue to bombard each other's positions in the north of the island.

The first shell hit the hospital at Puthukkudiyiruppu, known locally as PTK, late last night killing two and injuring five, the International Committee of the Red Cross said. The United Nations said the attacks had continued and its 15 staff and 81 family members had taken refuge in bunkers.

The dead include a four-year-old female relative of a UN staff worker. Gordon Weiss, a spokesman for the UN in Colombo, told the Guardian the hospital was one of the last functioning health institutions, with beds for 500 patients, inside rebel-held territory and could not say why anybody would target it.

"Our office is next to the hospital in PTK," he said. "The hospital is the main refuge for people in the area. It is overflowing with kids and women. We are very concerned as both sides are using artillery. The last communication that we had from our staff member on the ground was that they were still counting the dead."

The International Committee of the Red Cross called on both sides to stop the shelling, saying in a statement "wounded and sick people, medical personnel and medical facilities are all protected by international humanitarian law. Under no circumstance may they be directly attacked."

With the Sri Lankan military attempting to squeeze the Tamil Tigers into a ever smaller patch of the north-eastern shore, fighting has become bloody and intense. There are fears that the civilian death toll could rise.

Dr Thurairajah Varatharajah, the top government health official in the area, said last week more than 300 civilians had been killed in the recent fighting.

The army has denied killing civilians in its attempt to "eradicate" the rebels and end the island nation's 25-year-old civil war with the separatist group. The country's defence secretary, Gotabaya Rajapaksa, told the Guardian the army was not responsible for attacks on civilians and blamed the rebels, known formally as the Liberation Tigers of Tamil Eelam (LTTE).

"The LTTE is trapped ... They are firing shells everywhere … These have fallen on civilians," he said. "We were accused of shelling homes, and the proof was that the roof was missing. But it was the LTTE who had taken the roofs off the houses. There were no blast marks on the walls."

Last month, the former US deputy attorney general Bruce Fein, who is a longtime supporter of Tamil causes, said there was enough evidence to prosecute both the defence secretary and Sri Lanka's army chief under the US genocide accountability act. Sri Lanka's defence secretary is a US citizen and the army chief holds a green card.

The Sri Lankan government has barred journalists from operating in the areak, offering only "guided tours" of the 15,000 square kilometres prised from rebel control by the army. The military says the LTTE is down to its last 600 fighters.

The people who lived in the vast, forested area of Vanni, which used to be under LTTE control, have been scattered to either India or camps in central and eastern Sri Lanka, or have been left within the shrinking LTTE-controlled zone, thought to be barely 260 square kilometres.

The Red Cross estimates 250,000 civilians are in the rebel-held area, which is little more than jungle and villages, while the government says the number is smaller.

The rebels have been fighting since 1983 for a separate homeland for ethnic minority Tamils in the north and east after decades of marginalisation by governments controlled by the Sinhalese majority. More than 70,000 people have been killed in the civil war.