Orlin Wagner, File, Associated Press
In this Sept. 11, 2013 file photo, Rep. John Diehl Jr., R-Town and Country, calls for an end to debate during a special session at the Missouri State Capital in Jefferson City, Mo. Missouri House Speaker Diehl said, Thursday, May 14, 2015, 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.

JEFFERSON CITY, Mo. — 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 college student serving as a Capitol intern.

Diehl said he is stepping down both from his House speaker's position and from his elected job as a Republican representative from suburban St. Louis. He said the resignation will take effect either Thursday or Friday, depending on when an orderly transition can be arranged.

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

"I'm going to do what's best for the (House) body and the (Republican) caucus, and step aside out of my office," Diehl said in an interview with The Associated Press and reporters from three other media outlets.

"I made a mistake," Diehl said. "It's one that calls into question my ability to lead."

His resignation announcement came 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, who no longer works at the Capitol. Some of the messages were sexually suggestive.

Diehl, 49, is an attorney who lives with his wife and three sons in the St. Louis suburb of Town and Country. He first was elected in 2008 and had been chosen by colleagues as speaker in January to preside 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.

Several Republican House members said they planned to meet as a caucus Thursday evening to discuss nominating a new speaker, who would have to be elected by the full House. Legislators face a 6 p.m. Friday deadline to pass legislation this year.

Missouri Gov. Jay Nixon, a Democrat, described Diehl's resignation was "an appropriate and necessary step" and said he would work with the next speaker "to restore the public trust."

U.S. Sen. Roy Blunt, the top ranking Republican in Missouri, said Diehl "was an effective leader with significant accomplishments," but added: "He made the right decision today."

Democratic lawmakers had launched an effort to try to remove Diehl from the speakership. But Republicans had publicly continued to him, and Diehl indicated Wednesday evening that he intended to remain as speaker. On Thursday, Diehl said none of the other 116 Republicans in the House had asked him to resign and he decided to do so after further evaluating the situation.

"I think, too often, we see politicians and people in the public eye, when they do something wrong, say they're sorry but not necessarily (be) willing to suffer the consequences of that," Diehl said.

He later added: "You can talk the talk or walk the walk. I made a mistake, I don't think it disqualifies me, but I think it certainly violates the high standards that I've set for myself and this body and this office, and I'm embarrassed by it. I'm sorry.

"I'm not going to put my friends in this caucus or my friends and loved ones back home through drama that was created by my mistake," Diehl said.

Some of Diehl's colleagues who had remained publicly loyal said Thursday that they also supported his choice to step down.

"I think he did the right thing," said state Rep. Kevin Engler, a Republican from Farmington. "I thought he did a good job as speaker, but sometimes you're not able to lead anymore, and I think John didn't want to get in the way of progress."

The college freshman with whom Diehl had exchanged text messages had been an intern for another House member. She no longer works at the Capitol, and Missouri Southern State University also removed its three other Capitol interns.

The intern declined to comment Wednesday and referred the AP to attorney Phil Willoughby, a former Democratic state House member. She "is not interested in being at the center of any political debate concerning her internship or the workings of the state Capitol," Willoughby said.

Associated Press writers Marie French and Summer Ballentine contributed to this report.

Follow David A. Lieb at: https://twitter.com/DavidALieb .