By Ruffin Prevost

CODY, Wyo. (Reuters) - Montana reopened a stretch of the Yellowstone River to fishing and other recreational activities on Friday after a month-long closure prompted by the spread of a deadly aquatic parasite that killed thousands of whitefish and sapped the local economy.

Hot, dry conditions and low stream flows had exacerbated the spread of the microbial bug along the most heavily fished river system in a state where fly fishing is a cherished pastime for residents, and a key draw for visiting anglers who spend millions of dollars casting for trout in pristine waters.

The 17-mile (27-km) section of river upstream from the small tourist town of Livingston was the last to be reopened after an August 19 order closed 183 miles (295 km) of the river from Gardiner, near the northern boundary of Yellowstone National Park.

The closure was imposed by Montana's Fish, Wildlife and Parks agency and backed by Governor Steve Bullock, who last month said the rare but virulent parasite posed a threat to Montana's outdoor economy and tens of thousands of jobs.

News of the reopening comes as ExxonMobil Corp. agreed to pay $12 million to Montana and the U.S. government to restore natural resources damaged or destroyed by a pipeline rupture in 2011 that spilled oil into the Yellowstone River.

The agency has found more than 2,000 dead mountain whitefish along stretches of the Yellowstone River, with an estimated 20,000 or more presumed killed in the outbreak. Some rainbow trout and Yellowstone cutthroat trout have also been affected.

Recent cooler temperatures and wet weather have eased stress on the river and its fish.

"It has affected people profoundly, because the last couple of weeks of August are usually a most profitable time for us," said Dandy Reiner, owner of Hatch Finders Fly Shop in Livingston.

"I am worried about next year, whether this happens again or people are afraid to come fishing - I don't know what's going to happen," she said.

Reiner said many fishing guides and others who make a living along the river suffered a significant fall in income.

The closure cost the local economy an estimated $500,000 or more, the Institute for Tourism and Recreation Research at the University of Montana said this week.

Even so, some anglers saw the demise of thousands of whitefish as a good sign for the prized trout, which they said would now have less competition for food in the river.

(Reporting by Ruffin Prevost in CODY, Wyoming; Editing by Eric M. Johnson and Alden Bentley)