JEFFERSON CITY, Mo. (AP) – Missouri House Speaker John Diehl said Thursday that he is resigning from the Legislature after acknowledging that he exchanged sexually charged text messages with a Capitol intern.

Diehl said he is resigning both from his House speaker’s position and from his elected job as a Republican representative from suburban St. Louis.

Diehl acknowledged “making a serious error in judgment by sending the text messages” to the intern.

“I will be resigning the position of speaker of the House and the office of state representative in a way that allows for an orderly transition,” Diehl said in a prepared statement provided to The Associated Press.

His resignation comes a day after The Kansas City Star released a story accompanied by screenshots of what the newspaper said were electronic messages between Diehl and the intern. Some of the messages were sexually suggestive.

Diehl, 49, had been chosen by colleagues as speaker in January. He is an attorney who lives with his wife and three sons in the St. Louis suburb of Town and Country. He was first elected to the House in 2008 and now presides over one of the largest Republican legislative majorities in state history. He’s known for his ability to work deals and to persuade rank-and-file members to stick together on the party’s priorities.