A river in New Zealand has become the first in the world to be granted the same rights as a human being.

The local Maori tribe of Whanganui in the North Island has fought for the recognition of their river as an ancestor for 140 years.

Now the river – the third largest in New Zealand which flows 145km from the central North Island to the sea – will be given two guardians, one from the Maori tribes and one from the Crown.

"I know the initial inclination of some people will say it's pretty strange to give a natural resource a legal personality," said New Zealand's Treaty Negotiations Minister Chris Finlayson after the river was given legal personhood by the country's parliament on Wednesday 15 March.

"But it's no stranger than family trusts, or companies or incorporated societies."

The river's staus means that there is now no legal distinction between harming the river and harming the Whanganui people.

News of the legal status being granted was greeted with tears and music by hundreds of tribal representatives in New Zealand's parliament.

"The reason we have taken this approach is because we consider the river an ancestor and always have," Gerrard Albert, the lead negotiator for the Whanganui iwi [tribe], told the Guardian.

"We have fought to find an approximation in law so that all others can understand that from our perspective treating the river as a living entity is the correct way to approach it, as in indivisible whole, instead of the traditional model for the last 100 years of treating it from a perspective of ownership and management."

The settlement brought to an end the country's longest-running litigation, the NZHerald reports.

It also included $80m (£65m) in financial redress and $30m (£25m) to a fund to improve the river's health.