A man was arrested in Yellowstone National Park for threatening to kill 20 people at his wife’s office after he found out she was having an “emotional affair” with another man, authorities said.

The suspect, 44-year-old Joshua James Mjoness, was busted in a picnic area of the park on Sept. 18 with a handgun and 50 rounds of ammunition, police said.

Mjoness was believed to be on his way to Boise, Idaho, where his wife works, a US Attorney spokesperson said.

He texted his wife and his brother earlier in the day, demanding a photo of the man she was having the “emotional affair” with.

“Only two people would die rather than 20,” if they turned over a photo, he texted.

He then allegedly sent her a photo of a handgun and wrote, “Up to you.”

Investigators tracked his cellphone records and zeroed in on Yellowstone, authorities said.

He was arrested on illegal gun possession and making threats charges, police said.

With Post Wires