GAZA/JERUSALEM, Jan 24 (Reuters) - The United Nations said on Wednesday that Israeli tanks struck a huge U.N. compound in Gaza sheltering displaced Palestinians, causing "mass casualties", but Israel denied its forces were responsible and suggested Hamas may have launched the shelling.

The attack, which the U.N. said hit a vocational training centre housing 30,000 displaced people in Khan Younis, southern Gaza's main city, prompted rare outright condemnation from the United States.

"Mass casualties have taken place, some buildings are ablaze and there are reports of deaths. Many people are trying to flee the scene, but unable to do so," U.N. Humanitarian Coordinator for the Palestinian Territory James McGoldrick said.

Thomas White, director of Gaza affairs for the U.N. agency UNRWA, said two tank rounds hit one of the centre's buildings where some 800 displaced people were sheltering. At least nine people were killed and 75 wounded. The agency's head Philippe Lazzarini said the death toll was probably higher.

"The compound is a clearly marked U.N. facility and its coordinates were shared with Israeli Authorities as we do for all our facilities. Once again a blatant disregard of basic rules of war," Lazzarini said.

In Washington, U.S. State Department spokesperson Vedant Patel said: "We deplore today's attack on the U.N.'s Khan Younis training centre."

"Civilians must be protected, and the protected nature of U.N. facilities must be respected, and humanitarian workers must be protected so that they can continue providing civilians with the life-saving humanitarian assistance that they need," Patel said.

Israel's military initially released a statement describing the wider Khan Younis area as a base of Hamas fighters and acknowledged that fighting was taking place near large numbers of civilians.

In a second statement sent following Washington's criticism, the military said an examination of its operational systems ruled out that its forces had struck the centre. It added that a through review was still under way to examine the possibility that the strike was a result of Hamas fire.

Since Israel's ground offensive began in late October, Washington has raised concerns and asked Israel for information about incidents, but has rarely been openly critical of a specific Israeli action.

Hours after the attack as night fell, U.N. staff were still unable to reach the area and all communications were shut down.

Israeli forces have launched their biggest ground offensive in at least a month, encircling Khan Younis where hundreds of thousands of people who fled fighting elsewhere in Gaza are staying.

Residents said that Israeli announcements warning them to leave the area came only after the operation was under way and the main road out already shut.

The bulk of the 2.3 million-strong population of Gaza is now penned into Khan Younis and the towns just north and south of it. Palestinian officials say the Israelis have cut off and besieged the city's main hospitals, making it impossible for rescuers to reach many of the wounded and the dead.

Israel said that Hamas has "command and control centers, Hamas outposts and Hamas security headquarters" in the area.

"Dismantling Hamas' military framework in western Khan Younis is the heart of the logic behind the operation," the Israeli military said.

"It is a dense area and an area that consists of civilians, it is a place that requires very specific methods of action and precise operations. There is an area with shelters, there are several hospitals, several sensitive sites. We have seen terrorists use these sites."

Photo from Reuters