BISMARCK, N.D. — A Williston man who pleaded guilty to stealing explosives from companies operating in the North Dakota oil patch faces up to 20 years in prison and a $500,000 fine.

Tyler Porter, 36, was arrested in May and charged in federal court with five felonies that together carry a maximum punishment of 40 years in prison. He reached a plea deal with prosecutors and on Wednesday pleaded guilty to possession of a firearm by a convicted felon and theft of explosive materials. He’s to be sentenced Dec. 12.

Authorities said Porter stole more than 200 explosives last spring from two Williston-based oil field service companies by using a cutting torch to open padlocked bunkers. An informant said Porter planned to sell the explosives for thousands of dollars, according to an affidavit filed by U.S. Bureau of Alcohol, Tobacco, Firearms and Explosives special agent Daniel Mehlhoff.

Authorities also alleged Porter had books in his home on how to build explosives, titled “Field Methods for Explosives Preparations” and “Improvised Explosives — How to Make Your Own,” along with burglary equipment, prohibited guns and more than 1,100 rounds of ammunition.

The case was moved from state to federal court because the explosives were manufactured outside North Dakota.

Porter has a lengthy criminal history, including convictions on terrorizing and assault charges in North Dakota and burglary and grand larceny in South Carolina.