Deniz Baykal had led the Republican People's Party since 1992
The leader of Turkey's principal opposition party has resigned following the circulation of a video purporting to show him having an affair.
The video allegedly shows Deniz Baykal, who led the secularist Republican People's Party (CHP), in a bedroom with a female CHP politician.
Mr Baykal claimed he was a victim of a government-orchestrated plot.
His party is currently opposing constitutional reforms proposed by the governing AK Party (AKP).
Mr Baykal resigned during a news conference on Monday, during which he said such videos could not be aired without the knowledge of the government.
"This is not a sex tape, this is a conspiracy," he said.
"If this has a price, and that price is the resignation from CHP leadership, I am ready to pay it. My resignation does not mean running away, or giving in.
"On the contrary, it means that I'm fighting it."
Investigation under way
Both Mr Baykal and the woman allegedly shown in the video are married. In his news conference, Mr Baykal did not confirm or deny any affair.
The secretly-filmed video surfaced on YouTube last week.
Turkish prosecutors launched an investigation on Friday, banning the dissemination of the tape.
Mr Baykal, 71, had led the CHP since 1992. He had also served as foreign minister and deputy prime minster in previous governments.
The BBC's Jonathan Head reports from Istanbul that Mr Baykal has frequently been accused of failing to offer an alternative vision to challenge the AKP, and of acting only as a defender of the state's traditionally secular values.
With his departure, a younger and more imaginative generation of secular politicians will now have an opportunity to rise in the ranks of the party, our correspondent says.