Prime Minister Lee Hsien Loong said he accepted the resignations of speaker Tan Chuan Jin and member of parliament Cheng Li Hui to "maintain the high standards of propriety and personal conduct" of the People's Action Party (PAP).
He said they were in an "inappropriate relationship" that continued even after he had told them to stop in February.
It was the latest development to rock the PAP, which has ruled Singapore uninterrupted for 64 years and has prided itself on a corruption-free government.
Last week, Transport Minister S. Iswaran was arrested by the city-state's powerful Corrupt Practices Investigation Bureau in a rare probe into high-level corruption.
He is out on bail and is helping the bureau with its investigation.
Before that, two senior Cabinet ministers were probed for alleged irregularities in their rental of sprawling housing properties in the land-scarce nation, but both were subsequently cleared of any wrongdoing.
"Taken together, I would say that this is the most severe political crisis to hit the ruling party since 1986, when the minister for national development was investigated for corruption," said political analyst Eugene Tan.
"I think public trust and confidence in the ruling party would be would be significantly affected. And that puts the ruling party very much on the defensive," added Tan, an associate professor of law at the Singapore Management University.
Elections must be called no later than November 2025, with a younger generation of leaders expected to take the lead. Lee earlier said he would hand over leadership to his deputy Lawrence Wong, although no timetable was given.
Lee told reporters that speaker Tan, who is married with two children, offered to resign earlier this year when he spoke to him about the affair.
The premier accepted his resignation, but it was to take effect when arrangements for his replacement for his district were made.
Lee also said he told the speaker to end the affair.
"But very recently, I came across information that strongly suggested that the relationship had continued," he said.
In a letter to the prime minister, Tan said he needed to step down from politics to focus on his family.
"I have let them down ... I need to take responsibility for them and help heal my family," he wrote.