Dec. 16 (UPI) — The fates of the Duttons and the Montana ranch their family worked and protected for more than a century were revealed in Sunday night’s Season 5 finale of Yellowstone.

Spoilers ahead.

After the murder of patriarch John Dutton (Kevin Costner), his adult kids Beth (Kelly Reilly) and Kayce (Luke Grimes) were left with a seemingly impossible dilemma — come up with millions of dollars to pay inheritance taxes or sell to developers who would carve up their enormous pristine property and build resorts, shopping centers, condo complexes and airports.

Kayce saves the day, however, when he comes up with the idea to sell the ranch to Chief Thomas Rainwater (Gil Birmingham) for a tiny amount of money in keeping with a promise his ancestors made to the Native Americans in the area years ago to return the land to the Indigenous people in seven generations.

As part of the deal, Rainwater promises not to build on it or sell it.

Kayce and his family also were allowed to retain a house and small parcel of land for themselves, and the bodies of the dead Duttons, including John, are permitted to remain on the property.

The fact that Yellowstone will no longer be a working ranch means everyone who works there must find new jobs.

After an auction of the animals and equipment, a heartfelt private funeral is held for John and the cowboys go their separate ways.

Beth, meanwhile, has one bit of unfinished business before she and Rip can head off to the small new ranch she bought for them.

She has to kill Jamie (Wes Bentley), the adopted brother she holds responsible for their father’s death.

After a brutal confrontation in his home, Beth stabs Jamie and Rip and Lloyd (Forrie J. Smith) dispose of his body.

Beth calls the police and tells them Jamie attacked her and ran off after she confronted him for missing the funeral of the man he helped murder.

The episode, which was build as a season finale as opposed to a series finale, closes with Beth and Rip, and Kayce, and his wife Monica (Kelsey Asbille) and son Tate (Brecken Merrill) settling into their new homes.

Back at the ranch, Rainwater watches as fellow members of his tribe play music, take down the giant “Y” that was on the horse stables and start to dismantle John’s gorgeous lodge house in an effort to return the property to its natural state.

But when some kids start kicking over the Duttons’ tombstones, Mo (Moses Brings Plenty), Rainwater’s right-hand man, reprimands them for disrespecting people who protected the land.

He then rights the stones of John and his ancestor Elsa, who was played by Isabel May in the Yellowstone prequel, 1883.