BISMARCK, N.D. (AP) — North Dakota’s longest-serving state senator announced Monday that he would resign following a report that he had traded scores of text messages with a man jailed on child pornography charges.

Republican Ray Holmberg, 79, rose to become one of the state’s most powerful lawmakers in a career that spanned 46 years.

Holmberg’s resignation, effective June 1, comes after he had already stepped down on April 20 as head of a powerful panel that oversees the Legislature’s business between sessions, days after a published report that he had exchanged scores of text messages with a man jailed on child pornography charges. His term was scheduled to end on Nov. 30.

The Forum of Fargo reported on April 15 that Holmberg exchanged 72 text messages in August with Nicholas James Morgan-Derosier.

Prosecutors allege Morgan-Derosier possessed several thousand images and videos depicting sexually abused children. He also is accused of taking two children under the age of 10 from Minnesota to his Grand Forks home, with the intent of sexually abusing them.

Holmberg said in March that his current term would be his last. In a statement at the time, he said the stress of a session and a campaign would “only exacerbate a weakened ability to concentrate on the matters at hand and effectively recall events.”

Holmberg didn’t comment directly on the text messages when he announced he was quitting his leadership post on the Management Committee and had referred questions from The Associated Press to his attorneys.

Holmberg first told the Forum that he had read a newspaper story about the charges, then in a later interview said he had not, the Forum reported.

He told the Forum that his text messages with Morgan-Derosier were related to “a variety of things,” including patio work Morgan-Derosier did for him. He also told the newspaper that he no longer has the text messages.

“They’re just gone,” he said.

Democratic Party Chairman Patrick Hart had called for Holmberg to step down from Legislative Management and to publicly release the text messages.

Holmberg has been one of the Legislature’s most powerful lawmakers for decades, serving as chairman of the Senate Appropriations Committee. He chaired the Legislative Management Committee, which decides committee assignments and chooses study topics that often inspire legislation, four times.

He also sat on the state’s Emergency Commission, which allocates funding and resources in times of an emergency, and served on or chaired several GOP-led redistricting committees.