Thousands of people in Nigeria's Lagos State were left homeless on Sunday after police stormed an informal fishing settlement and set fire to their homes, according to rights groups and residents.

Members of the Otodo Gbame riverine community said armed police fired bullets and tear gas indiscriminately, forcing them onto canoes in the water as their houses were levelled.

One man was shot in the neck and later died, residents and Justice and Empowerment Initiatives (JEI), a Lagos-based group working with the community, told Al Jazeera.

The forceful eviction followed the destruction of the homes of more than 4,700 people in the settlement in mid-March for environmental and health reasons, according to local authorities.

"[Police] came very, very early in the morning [of Sunday]," Tina Edukpo, a 21-year-old Otodo Gbame resident, told Al Jazeera by phone.

"When I saw them, I was surprised," she said.

JEI codirector Andrew Maki, who arrived at the community shortly after the demolitions began, said that at least 50 to 60 officers and 10 police vehicles were in Otodo Gbame in the morning.

He told Al Jazeera that the Lagos State Task Force officer in charge at the site told him and residents that police were there on the orders of the governor.

'Security measure'

According to the Lagos State Governor's Monitoring Team Twitter account, Sunday's demolition was carried out as a "security measure in the overall interest of all Lagosians".

It said it believes "militants" were using the community as a base, an accusation residents and rights groups deny.

It also said the settlement was "illegal, without any title or appropriate government approval".

Maki said on Sunday that police shot tear gas and bullets, forcing thousands of residents onto boats.

"Everyone in the community was forced onto the water, there were hundreds of boats," Maki said.

Paul Kunnu, another Otodo Gbame resident, said people had nowhere to go but the water.

"They started shooting tear gas and bullets," Kunnu, 38, told Al Jazeera. "So many people started running into the water."

He also said he remained on a boat in the water for nearly 12 hours and was continually pushed away from the land by marine police as other officers set fire to the remaining homes.

According to residents and JEI, a 20-year-old student was shot in the neck. Video from Sunday shows a bleeding man being rushed in a canoe for help. Maki, from JEI, said the man died in the boat before getting to the hospital.

Authorities were not available for comment on the death.

READ MORE: Nigeria - Fishermen and chiefs

The Otodo Gbame community is one of many informal settlements along the waterfront of Lagos, Nigeria's commercial capital.

In January, a Lagos court issued an injunction halting demolitions in such communities after an estimated 30,000 Otodo Gbame residents were evicted in November 2016 to make way for development projects, rights groups said.

JEI and Amnesty International accused the government of violating that court order on March 17 when excavators and police razed of homes of at least 4,700 Otodo Gbame residents.

Following last month's demolition, Lagos State Governor Akinwunmi Ambode issued a statement defending the move, saying it was not in violation of the January injunction.

Ambode said the evictions were carried out "to ensure that the waterfront area is free from environmentally injurious and unsanitary habitation a few months after it was consumed by fired and rendered uninhabitable".

The government has also said it was not responsible for the fire that displaced thousands in November 2016, instead blaming an "ethnic clash" between residents of different communities.

A ruling on a court case against the governor and other Lagos officials - filed by JEI and dozens of waterfront communities in Lagos - over the March demolition is expected on Wednesday.

'We have to rebuild'

Last year, rights groups warned that more than 300,000 people faced eviction from waterfront communities across the state of Lagos.

Makeshift housing is common in the poorest parts of Lagos, a city of more than 20 million people.

Morayo Adebayo, a senior researcher at Amnesty International, accused the government of grabbing land.

"This is a land-grab situation. That is what is happening," Morayo told Al Jazeera by phone on Sunday.

"Otodo Gbame residents are fishermen who derive their daily sustenance from the water," she said. "They have been here for more than 80 years."

Residents, including Kunnu and Edukpo, vowed to rebuild.

"I want to rebuild my home because I don't have any other place to go," Edukpo said. "This is the third time they have demolished my home."

Kunnu agreed.

"[These are] our homes where our fathers and grandfathers have lived," he said. "We have to rebuild."