Pervez Musharraf stepped down Wednesday from his powerful post as Pakistan's military commander, a day before he was to be sworn in as a civilian president in a long-delayed pledge not to hold both jobs.

During a change of command, Musharraf relinquished his post by handing over his ceremonial baton to his hand-picked successor, Gen. Ashfaq Kayani.

"(You) are the saviors of Pakistan," Musharraf said in an emotional final speech to the troops. He appeared to be blinking back tears as the guard of honor performed a final march-by.

Musharraf's retirement from the military has been a key opposition demand and the move may help defuse a possible boycott of parliamentary elections in January by parties opposed to his rule. Since seizing power in a coup in 1999, Musharraf has served as president while retaining his post as head of the armed forces.

Musharraf was re-elected to serve a new presidential term by parliament in October, but his confirmation was held up by the Supreme Court following complaints that a military man could not constitutionally serve as an elected head-of-state.

He reacted by proclaiming a state of emergency on Nov. 3, sacking the chief justice and other independent judges and replacing them with his appointees. The reconstituted top court then duly approved his election.

On Wednesday, hundreds of senior officers, politicians and other civilians watched from the stands as an unsmiling Musharraf, wearing a phalanx of medals and a green sash across his uniform, reviewed the ranks to the strains of "Auld Lang Syne."

"I'm proud of this army and I was lucky to have commanded the world's best army," Musharraf said. "I will no longer command ... but my heart and my mind will always be with you."

Opponents on Tuesday welcomed Musharraf's belated conversion to civilian rule and appeared to pull back from a threat to boycott the elections.

Nawaz Sharif, the prime minister Musharraf ousted in a 1999 coup, said Musharraf's conversion to a civilian president would make "a lot of difference," and he would only refuse to participate in the vote if all opposition parties agreed to do so as well.

But Sharif also kept up his rhetoric against the general, insisting that Musharraf lift the state of emergency.

Musharraf has faced increasingly adamant calls from critics at home and abroad to lift the emergency and make good on a long-standing pledge to restore civilian rule. To calm the turmoil, he has released thousands of opponents and let all but one of Pakistan's independent news channels go back on the air.

Musharraf insists his continued rule as president is essential for Pakistan, which faces an increasingly violent onslaught from Islamic extremists, to remain stable as it reverts to democracy.

The crackdown on dissent has dealt a blow to his relations with Benazir Bhutto, another former prime minister who has returned from self-exile and who shares his secularist, pro-Western views.

Bhutto, who has twice been put under house arrest to stop her from leading protests, has joined Sharif in denouncing Musharraf's backsliding on democracy. However, she and Sharif are fierce political rivals, and there are doubts that they can forge a united front to force out Musharraf.

Kayani, a close associate of Musharraf, is widely expected to maintain the army's pro-Western policies even as he tries to repair the image of a force damaged by its direct involvement in politics.

An official insisted Tuesday that Musharraf's switch would bring no change in resolve against terrorism.

"Uniform or no uniform, it would not impact our war on terror," Interior Ministry spokesman Javed Iqbal Cheema said.

Sharif, who returned Sunday from exile in Saudi Arabia, went on CNN in September to calm doubts about his commitment to battling the Taliban and al-Qaida.

"You can't fight terror the way Mr. Musharraf is fighting," Sharif said, adding that the Pakistani leader "needs the threat of terror for his own survival. We will fight out of conviction."

But Sharif, a conservative with good relations with religious parties, is reaching out to the many Pakistanis who disagree with sending the army to fight militants along the Afghan border and who deride Musharraf as an American stooge. Civilians as well as militant have died in those operations and occasional U.S. missile strikes on targets inside Pakistan.

"If the outside world declares somebody a terrorist, we shall not act on it blindly," he told reporters in his home city of Lahore. "We are against extremism and terrorism. But it doesn't mean to allow foreign countries to bomb our people."

That posture could entice some votes away from Bhutto, who has said she might let U.S. troops strike at Osama bin Laden if the al-Qaida leader is found in Pakistan.

It remains unclear whether Sharif can assemble a slate of candidates strong enough to challenge the pro-Musharraf ruling party or Bhutto's party in January.

Still, a day after filing his nomination papers, Sharif gave the strongest hint yet that he would actually take part.

"If all political parties agree, I think we should boycott the polls because it is a lethal weapon," he said. "But if we don't get an agreement, we should try to reach our objectives in the polls."