The highly-irregular move will undoubtedly raise eyebrows.
But it puts an end to the country's longest-running legal dispute between the local Maori iwi, or tribe, which had been fighting the government to assert their rights over the river since the 1870s.
The river, known by Maori as Te Awa Tupua, is New Zealand's third longest.
"(It) will have its own legal identity with all the corresponding rights, duties and liabilities of a legal person," Attorney-General Chris Finlayson said.
"The approach of granting legal personality to a river is unique. This legislation recognizes the deep spiritual connection between the Whanganui iwi and its ancestral river."
In practical terms, the river can be represented at legal proceedings with two lawyers protecting its interests, one from the iwi, the other from the government.