John Diehl Jr., a real estate development and construction partner at Husch Blackwell in St. Louis, resigned as Missouri House speaker on Thursday less than 24 hours after publicly apologizing for sexually charged text messages he exchanged with a college freshman.

Diehl, a Republican initially elected speaker of Missouri’s House of Representatives in 2013 and reelected last fall, joined Husch Blackwell in October from Armstrong Teasdale. On Wednesday, the Kansas City Star broke the news of his indiscretions with an unnamed woman working as a legislative intern, including screenshots of what the newspaper described as a “flirty rapport” suggestive of a more intimate relationship.