The UN agency for Palestinian refugees says a member of staff was killed and 22 others were injured when Israeli forces hit a food distribution centre in Rafah, in the southern Gaza Strip.
UNRWA chief Philippe Lazzarini said attacks on its facilities had "become commonplace in blatant disregard to international humanitarian law".
The Hamas-run health ministry said an Israeli air strike killed five people.
The Israeli military said it killed a Hamas commander in a "precise strike".
It identified him as Mohammed Abu Hasna and alleged that he had been a "combat support operative" in Hamas`s military wing in the Rafah area.
A man with that name was on a list of five fatalities given by health officials.
Rafah is crammed with an estimated 1.5 million Palestinians who are seeking shelter from Israel`s ground offensive elsewhere in Gaza.
The UN`s secretary general has warned that a threatened Israeli assault on the city could "plummet the people of Gaza into an even deeper circle of hell".
The war in Gaza began when Hamas gunmen attacked southern Israel on 7 October, killing about 1,200 people and taking 253 others as hostages.
More than 31,200 people have been killed in Gaza in the military campaign that Israel launched in response, according to the Hamas-run health ministry.
Wednesday`s strike reportedly hit the eastern side of the UNRWA food distribution centre, which is in the eastern part of Rafah.
UNRWA spokeswoman Juliette Touma told the BBC that up to 60 people were believed to have been working at the facility, which also served as a warehouse for food and other critical supplies.
"We know that it is the Israeli forces who were responsible. Our teams were on site and they reported back the casualties," she said.
Pictures of the aftermath showed a pool of blood in a courtyard outside a blue-and-white painted warehouse, and another pool just inside the doorway of the building, next to boxes of aid.
A 15-year-old boy and four men aged between 27 and 50, one of them called Mohamed Abu Hasna, were reported killed.
People were also filmed at a local hospital next to the bodies of five people, one of whom was a man wearing a blue UN tabard.
"It`s a UNRWA centre, expected to be secure," UNRWA staff member Sami Abu Salim told the AFP news agency as he surveyed the damage.
"Some came to work to distribute aid to the people in need of food during the
holy month of Ramadan. Suddenly, they were struck by two missiles."ReutersAn estimated 1.5 million Palestinians are sheltering in Rafah with scarce access to safe drinking water or food
On Wednesday evening, the Israel Defense Forces (IDF) put out a statement saying its aircraft had "precisely targeted and eliminated a terrorist in Hamas`s Operations Unit in the area of Rafah, Mohammed Abu Hasna", without mentioning the UNRWA facility.
"He was also involved in taking control of humanitarian aid and distributing it to Hamas terrorists," it added.
"Furthermore,
Hasna co-ordinated the activities of various Hamas units, as well as communicated with and activated Hamas field operatives. Hasna was also responsible for an intelligence operations room which provides information on IDF positions for use in Hamas attacks."Mr Lazzarini said: "Today`s attack on one of the very few remaining UNRWA distribution centres in the Gaza Strip comes as food supplies are running out, hunger is widespread and, in some areas, turning into famine."
"Every day, we share the co-ordinates of all our facilities across the Gaza Strip with parties to the conflict. The Israeli army received the co-ordinates including of this facility yesterday."
UNRWA says at least 165 of its 13,000 employees in Gaza have been killed and more than 150 of its facilities have been hit since the start of the war.
More than 400 people have also been killed while seeking shelter under the UN flag, according to the agency.
Israel has accused UNRWA of supporting Hamas, which is proscribed as a terrorist organisation by Israel, the UK, US and other countries.
The agency has denied this, but in January it sacked nine of the 12 employees accused in an Israeli document of playing a part in the 7 October attacks.
The UN has yet to publish the results of an internal investigation launched as the US and other donors paused funding in response to the allegations.