FARGO, N.D. — A man accused of storing stolen explosives, guns and hundreds of rounds of ammunition in his western North Dakota home has signed a plea agreement with the government, according to federal court documents released Wednesday.

Authorities accuse Tyler Porter, 35, of stealing more than 200 explosives from two companies operating in the North Dakota oil patch by using a cutting torch to open padlocked bunkers. They also allege he had books in his home in Williston on how to build explosives.

An informant told a regional drug task force that Porter planned to sell the explosives for thousands of dollars, according to an affidavit filed by a special agent with the U.S. Bureau of Alcohol, Tobacco, Firearms and Explosives. State investigators called the cache especially troublesome due to the house being in a residential area.

Under the agreement, Porter will plead guilty to possession of a firearm by a convicted felon and theft of explosive materials. The government would drop charges of possession of an unregistered firearm, receipt of explosive materials, and possession of explosive materials by a prohibited person.

Neil Fulton, who runs the federal public defender’s office in North Dakota and South Dakota, did not immediately respond to a request for comment.

The explosives, known as shaped charges, are commonly used to penetrate oil wells. Porter allegedly stole 171 of those from Go Wireline LLC in April and 29 from Pioneer Wireline Services in May. Court documents show that Porter also took a 500-foot roll of detonation cord during the May theft.

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

A change of plea hearing has not been set. Porter faces a maximum penalty of 20 years in prison and a $500,000 fine.