CHS on Wednesday canceled plans to build a $3.3 billion fertilizer plant in North Dakota, opting instead to buy a $2.8 billion stake in fertilizer maker CF Industries.

CHS, the nation’s biggest farm cooperative and largest fertilizer wholesaler, chose a less risky and quicker way into direct production of nitrogen fertilizer. Costs were rising significantly for the proposed southeastern North Dakota plant, it said.

By investing in CF, “you can deliver similar economics with much less risk,” CHS chief executive Carl Casale said in an interview.

CHS, which is headquartered in Inver Grove Heights, will be entitled to semiannual profit distributions from CF, which is based in Deerfield, Ill. CHS also entered a long-term fertilizer supply agreement with CF and will write off $85 million in costs for the North Dakota project.

Just last week, CF agreed to buy the fertilizer production assets of the Dutch firm OCI NV for about $5.4 billion. That deal made CF the world’s largest publicly traded maker of nitrogen fertilizer. On news of the CHS deal, CF’s stock rose 8 percent.

The $2.8 billion CF investment is the largest CHS has ever made in another company, though it is less than what it would have spent on the plant in North Dakota.

CHS, which had about $43 billion in revenue last year, is best known for grain handling and petroleum products, which it refines and sells under the Cenex brand. The co-op decided to move beyond fertilizer wholesaling into production in order to capture more profits.

CHS announced plans in 2012 to build a nitrogen fertilizer plant in Spiritwood, a town about 85 miles west of Fargo. The company was attracted to North Dakota’s cheap and plentiful supply of natural gas — a key feedstock for the plant — and the proximity of Spiritwood to CHS’ many farmer members in the Dakotas and Minnesota.

The CHS plant would have been the largest single private investment in recent North Dakota history, greater than any individual investment in the state’s booming oil and gas industry, state officials had said.

“Of course we are disappointed CHS has decided not to move forward with the project,” said Jeff Zent, a spokesman for North Dakota Gov. Jack Dalrymple. “But we understand it was weighed against getting an immediate stake” in fertilizer production.

With the CF deal expected to close early next year, CHS will be in nitrogen production a lot sooner than it would with the Spiritwood plant, which wouldn’t have been completed until 2018 or 2019. Building the plant would also have required moving construction trades workers into North Dakota and providing housing for them.

“The costs have escalated significantly,” Casale said. Indeed, the plant’s price tag rose from about $1.4 billion when originally announced to nearly $2 billion by April 2014 and $3 billion just six months later. The current cost is pegged at $3.3 billion.

Also, water is a “huge feedstock” for a fertilizer plant and CHS was grappling with North Dakota’s water restrictions during a potential drought, Casale said. “We could find ourselves with conditions of use.”

While acknowledging the probability of water restrictions was small, “it’s not zero,” Casale said. “With a project of $3 billion, you can’t work with that risk,” he added.

Todd Sando, state engineer for the North Dakota State Water Commission, said the state had “taken care” of the water issue. Plans called for a 110-mile pipeline to be built from the Missouri River to the Spiritwood area, ensuring a long-term steady water supply. In the interim, groundwater would be used to forestall any shortage in a drought, Sando said.

But Casale said that “despite our best efforts and the best efforts of the state, the water solution was imperfect.”

CHS’ investment in CF does not entail buying the company’s publicly traded stock. Rather, it is buying a stake in CF’s nitrogen fertilizer subsidiary and inking a long-term supply agreement. CHS will buy up to 1.7 million tons of fertilizer annually for 80 years. It is essentially buying into part of CF’s production profits for nitrogen fertilizer.

Plans for the North Dakota plant pivoted on capturing fertilizer manufacturing profits for CHS farmer-members. That same goal should be realized by investing in CF. Fertilizer manufacturing should eventually become CHS’ second-largest profit center, Casale said.