A flood bank built without planning permission "protects life" and can stay, councillors have decided.
Farmer John Flintoff, from Crakehill, near Thirsk, North Yorkshire, took nine months to build the 8ft (2.5m) high structure.
He said flooding from the River Swale threatened his neighbour's safety and his business.
Councillors granted retrospective consent for the structure despite objections from the Environment Agency.
Hambleton District Council's planning committee heard Mr Flintoff had built the 722ft (220m) long bank after he was offered 4,000 tonnes of soil, according to the Local Democracy Reporting Service.
A report to the committee said his elderly neighbours, Brian and Violet Coatsworth, spent hours pumping water over a flood wall at the front of their home in 2012.
It eventually collapsed and Mr Coatsworth could have been killed if he had been closer to it.
"We heard the River Swale rumbling, Brian was baling out water and then it came over the top of the wall like a tidal wave," Mrs Coatsworth said.
"Brian was clinging to a doorframe and I got swept from one end of the living room to the other."
Council officers said the bank "protects life and enables safe access" at times of flooding.
The Environment Agency's objection related to the fact it believes the bank has reduced the capacity of the flood plain by about 25,000 cubic metres.
Councillor Bridget Fortune said she did not like anyone to build without permission, but she was disappointed by the lack of support from the Environment Agency given the risk to lives.
"I think the farmer must be commended because it obviously has been a very destructive force for quite some time," she said.