Survivalist Joseph Badame is making the best of a bad situation.

The 74-year-old architect was devastated when M&T Bank recently began foreclosure on the Medford, New Jersey, home that he and his late wife Phyliss had spent more than four decades turning into a 8,500-square-foot prepper compound.

But instead of throwing away the dozens of barrels they’d packed with supplies so that up to 100 of their friends and relatives could survive a possible economic meltdown and the end of society, Badame is sending the stock to Puerto Rico to aid victims of Hurricane Maria.

“Phyliss and I prepared all this for one group of people and it turns out it’s going to help another group of people,” said Badame, whose wife died from cancer in 2013. “That’s wonderful,” he told NJ.com.

The idea to donate the supplies emerged after Badame decided to sell most of his belongings in anticipation of his eviction.

During his estate sale over the weekend, Badame met the owners of a food truck who were raising money to help relatives on Puerto Rico who’d been left homeless in the aftermath of the devastating storm.

Badame donated $100 to Anthony and Victoria Barber’s fund and told them they could have all 70-plus barrels, each weighing 300 pounds and filled with medical supplies and enough dried food to keep 84 people well fed for up to four months ― if they could get it off the property themselves.

“I saw everything that my family would need or eat,” said Victoria Barber, who has since arranged for the first shipment to be flown to Puerto Rico on Monday. “This is a divine intervention that we are able to have all this food, and not just have the food, but have the means to get it there.”

“Honestly, I was overwhelmed with joy,” Barber told HuffPost. “This was life-saving for my family. The amount of supplies is amazing. I get choked up just thinking about it because it will allow us to not help my family, but an entire community.”

Volunteers are now helping the trio remove the barrels from Badame’s home before the bank completes the foreclosure process. And in a further heartwarming development, Badame is temporarily living in an RV on the Barbers’ land. Anthony Barber is now describing him as “family.”

“He’s awesome,” Barber told WTXF. “You don’t meet people like that around here.”