He added that the ruling AK party must have had knowledge of the videotape.

"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," he said.

"On the contrary, it means that I'm fighting it."

'Unprecedented'

Anita McNaught, Al Jazeera's correspondent in Istanbul, said the case was "unprecedented event in Turkish politics.

"There has never been a sex scandal that's toppled a political leader of this seniority. Turkish politics historically has been full of dirty tricks on all sides, but this seems to be a dirtier trick than most."

She said a high level of sophistication was involved in making the video - using a camera planted in a wardrobe in a private house.

"There is absolutlely no indication of who might have been responsible for that.

"In fact the prime minister has asked the head of military intelligence to start looking into how it might have happened.

Baykal said the video was aimed at weakening his party's efforts to prevent the ruling party from implementing its alleged Islamist agenda.

"The target of this conspiracy is not just one person, but the struggle of the CHP...to uphold the republic, democracy and the rule of law," he said.

The CHP has been fighting a constitutional reform package that the government is preparing to send to a national referendum.

Baykal's party had tried to block the reforms through the Constitutional Court.

His resignation, which ended a four-decade political career, also came two weeks before a party congress when he was expected to seek a fresh mandate as the CHP leader.