Pakistan's leader has agreed to step down as military head next year as part of a deal with hardline Islamists to end a parliamentary stand-off.
Musharraf will also give up some executive powers
President Pervez Musharraf will also give up some of the powers he assumed after his bloodless coup in 1999.
The hardline Muttahida Majlis-e-Amal (MMA) Islamic coalition has agreed to end its disruption of parliament.
A constitutional amendment will be brought before parliament on 26 December to cement the deal.
'Good for democracy'
President Musharraf confirmed his move in a nationwide TV address late on Wednesday.
He said: "It was a difficult decision for me. I have been saying that a president in uniform is undemocratic, but it was important due to the peculiar circumstances in Pakistan.
"I have taken the decision in the interest of political harmony in the country."
Under the agreement, General Musharraf remains as president but will have to seek Supreme Court approval if he wants to sack the government.
Prime Minister Zafarullah Jamali oversaw the signing of the accord.
"An agreement has been reached on all issues," he said.
Information Minister Sheikh Rashid Ahmed told the Associated Press news agency: "It is good for democracy and good for the stability of the country. The president has proven he is sincere about democracy."
Senior MMA leader Liaquat Baloch said: "It is an historic development as it is the first time a military ruler has agreed to constitutional amendments."
Mr Baloch said the president would face a vote of confidence early next year but that the Islamic parties would not oppose him.
President Musharraf will not step down as head of the armed forces until the end of next year.
Legal Framework Order
Correspondents say President Musharraf's move may also open the way for Pakistan's readmission to the Commonwealth.
The country's attempts to rejoin the organisation at a summit in Nigeria last month were blocked partly because of his dual role.
The MMA has rallied members against the LFO
It was in a referendum in April 2002 that President Musharraf secured a new five-year term.
In August of that year he introduced sweeping reforms known as the Legal Framework Order to strengthen his position.
He gave himself the power to dismiss the national assembly at his discretion, a power withdrawn by the government of the previous prime minister, Nawaz Sharif.
President Musharraf was also able to choose the heads of Pakistan's army and navy.
A National Security Council was also set up to monitor governments.
The reforms were intended to show a move towards democracy, and parliament convened for the first time in three years in November 2002, following elections the previous month.
However, many members of parliament opposed the new powers, calling them deeply undemocratic.
The MMA has since virtually paralysed parliamentary proceedings over the stand-off.
In the 55 years of its existence, Pakistan has not been able to find a workable model of democracy.
There have been repeated interventions by the military and not once has there been a smooth transfer of power from one elected government to another.