Jailed Kurdish rebel leader Abdullah Ocalan has ordered his fighters to cease fire and withdraw from Turkish soil.

The move is seen as a major step towards ending a conflict that has killed an estimated 40,000 people, riven the country and battered its economy.

Hundreds of thousands of Kurds gathered in the Turkish city of Diyarbakir.

They cheered and waved banners bearing Ocalan's image when a letter from the rebel leader, held since 1999 on a prison island in the Marmara Sea, was read out by a pro-Kurdish politician.

"Let guns be silenced and politics dominate," he said to a sea of red-yellow-green Kurdish flags.

"The stage has been reached where our armed forces should withdraw beyond the borders ... It's not the end. It's the start of a new era."

Prime Minister Tayyip Erdogan had taken a number of steps extending cultural and language rights to Kurds, although activists had continued to demand greater freedom from Ankara.

Mr Erdogan, talking in the Netherlands, welcomed the ceasefire call but said the real test would be putting it into action.

Military operations would stop if the rebel guns fell silent.

"From the time it is implemented, the atmosphere in Turkey will change. I believe in this," he said.

But he condemned the absence of the Turkish flag at the Diyarbakir rally.

Mr Ocalan gave no timetable, but it is thought rebels will withdraw to bases in the Qandil mountains, across the border in Iraq.

The area has been used by rebels as a springboard for attacks in Turkey. The Turkish air force has bombed the area in the past.

The Kurdistan Workers Party (PKK), regarded by the United States, European Union and Turkey as a terrorist group, launched its campaign in 1984, demanding an independent Kurdish state in the southeast of Turkey.

It has since moderated its demands to political autonomy and broader cultural rights in an area where the Kurdish language was long formally banned.