Media playback is unsupported on your device Media caption More than seven million people were urged to leave their homes

The Japanese prime minister has said typhoon shelters "should be open to everyone" - after two homeless people were turned away during the country's worst storm in decades.

Typhoon Hagibis brought heavy rain and winds of 225km/h (140mph) to Japan at the weekend, killing 72 people.

But when two homeless men tried to use a shelter in Tokyo, they were turned away as they did not have addresses.

The case has caused huge debate in Japan - with not everyone sympathetic.

What happened at the shelter?

As Hagibis took hold on Saturday morning, a 64-year-old homeless man went to a primary school, which was being used as an evacuation centre.

The school was in the Taito ward of Tokyo, which includes San'ya - an area historically home to many labourers, and now homeless people.

According to officials who spoke to the Asahi Shimbun, the man was asked to write his name and address. When he said he had no address, he was turned away.

"I told them that I have an address in Hokkaido [Japan's northern island, hundreds of miles from Tokyo], but they still denied me entry," he said.

Image copyright Getty Images Image caption Cleaning up in Kawasaki, Japan, after the typhoon

The man said he instead spent the night under an umbrella beneath the eaves of a building.

"I wanted them to allow me into the facility because the wind was strong and it was raining," he said.

Another homeless man was turned away later that afternoon.

What was the reaction?

As news spread on social media, there was outrage at the shelter's decision.

"Is this a country that's going to host the Olympics in Tokyo? [in 2020]" asked one Twitter user. "People from abroad would see this and think this is a terrible country."

The San'ya Workers' Welfare Centre, a charity, responded by opening as a shelter on Saturday night.

But others were less sympathetic, suggesting "smelly" or "mentally ill" homeless people should only be allowed into shelters if there was a separate space.

"If you claim your rights, do your duties first," said one Twitter user. "Can you sleep next to a stinking person?" asked another.

Image copyright Getty Images Image caption Shinzo Abe speaking in parliament earlier this month

Prime Minister Shinzo Abe was asked about the case in parliament and said "evacuation centres should let anyone in who has come to evacuate".

"We will look into the facts and take appropriate measures," he added.

The Taito ward said it would review its procedures to help people without addresses in the ward.

'A visible libertarian streak'

Analysis by Yuko Kato, BBC News, Tokyo

Most of 1,126 homeless people in Tokyo dwell in parks, on the streets, and by the river.

Rarely do they mingle with the rest of the population - but the typhoon brought them to the forefront of our consciousness.

On Saturday night, as the torrential rain and huge gusts of wind were coursing through Tokyo, word began to spread about the shelter in Taito.

Many people were immediately outraged. On the other hand, some voiced concerns about hygiene, while others were concerned about the homeless people's mental condition.

Some were simply scared to share the same space with them.

Social media also showed up the libertarian streak that has become quite visible in Japanese public opinion. Some even said the homeless shouldn't benefit from public services because they don't pay taxes.

Many rejected this - not just in terms of human decency - but also pragmatically, as the homeless do pay taxes when they buy something.