[Read more about the new governor of Missouri.]

Missouri will remain firmly in the hands of Republicans, who control both the governor’s office and the legislature. Rarely has a lieutenant governor in Missouri taken over in this way, midway through a term; in 2000, Mel Carnahan, then the governor, was killed in a plane crash and Roger Wilson, the lieutenant governor, took his place.

Mr. Greitens’s public problems began in January with his admission of an extramarital affair. He and his wife, Sheena, described the situation as a “deeply personal mistake” in a joint statement, adding: “Eric took responsibility, and we dealt with this together honestly and privately.” But in the months that followed, the scandal only grew, even as Mr. Greitens tried to move past it, making statements on tax cuts and funds to produce biodiesel.

The governor’s former hairdresser described an alarming sexual encounter, in which she said that he had taken a photo and threatened to share it if she told anyone about them. All the while, questions began to emerge about whether he had used the veterans’ charity list to help his political campaign in 2016.

Mr. Greitens’s resignation ends the need for an impeachment process. But it is unclear whether his criminal problems are over. The prosecutor in Jackson County, which includes much of Kansas City, is still investigating him and could refile an invasion-of-privacy charge that was dropped earlier this month, stemming from the hairdresser’s accusation that Mr. Greitens had taken an explicit photo.

In addition, the governor faces one felony charge: tampering with computer data, in connection to misuse of the donor list. A lawyer for Mr. Greitens has called the charge “absurd.”

Shortly after he announced his resignation, Kimberly Gardner, the St. Louis prosecutor, said in a statement that she had “reached a fair and just resolution” of the computer tampering charge, and that details would be announced Wednesday.

Mr. Greitens offered few details about his decision to resign, and Missouri politicians speculated about reasons he might have quit now — after months of fighting back. Earlier on Tuesday, a judge had ordered the governor’s campaign fund and a political action group tied to Mr. Greitens to turn over documents to lawmakers considering impeachment, a decision seen as a major blow to the governor.