Gen Pervez Musharraf has easily won a vote to be re-elected Pakistan's president, even though it is unclear if his candidacy was legal.
Gen Musharraf's supporters are celebrating
He won all but five of the votes cast in parliament's two houses and swept the ballots in the four provincial assemblies, election officials said.
Opposition MPs abstained or boycotted the vote, calling it unconstitutional.
The Supreme Court says no winner can be declared until it decides whether Gen Musharraf can stand while army chief.
In a statement shortly after results were announced, Gen Musharraf thanked those who had voted for him.
Dressed in civilian clothes, he appealed to people to end protests against his rule.
"And I again give my offer of reconciliation to all political parties."
As expected, Gen Musharraf won by a landslide.
His supporters dominate the assemblies, thanks to elections five years ago which were widely condemned as rigged.
Chief Election Commissioner Qazi Muhammad Farooq told the National Assembly that Gen Musharraf had won 252 of 257 votes cast in the upper and lower houses.
He said his nearest rival, Wajihuddin Ahmed, had won just two votes. Three votes had been rejected.
There was a similar picture in the assemblies in the provinces of Punjab, Sindh, North West Frontier and Balochistan.
Ruling party members claimed victory even before counting had begun, calling it a step on the way to "full democracy".
The opposition said the constitution had been flouted.
"We will not accept him as president... He is a person who has hardly any respect for the rule of law," Sadique ul-Farooq, a leader of the party of exiled former Prime Minister Nawaz Sharif told the Associated Press news agency.
Security was tight in cities across Pakistan, after opposition parties and lawyers' groups called for protests.
In Peshawar in the north-west police fired tear gas at lawyers protesting near the provincial assembly building.
'Just a formality'
Pakistan has been engulfed in political upheaval in recent months, at the same time as the security forces have suffered a series of blows from pro-Taleban militants opposed to Gen Musharraf's support for the US-led "war on terror".
06 Oct: Presidential vote is held
17 Oct: Supreme Court to resume hearing challenges to Musharraf candidacy
18 Oct: Date ex-PM Benazir Bhutto has set for her homecoming
15 Nov: Parliamentary term ends and general election must be held by mid-January
Gen Musharraf will step down as army chief, but only if he is re-elected, his lawyers have said.
But a ruling by the Supreme Court on Friday throws the presidential election into confusion.
It means that even though Gen Musharraf has the most votes he cannot be declared winner until the court has decided if he was a valid candidate in the first place.
The judges said they would not make a final decision before 17 October, which coincides with the day Ms Bhutto says she will leave London to return from years of self-imposed exile.
A deal announced on Friday with former PM Benazir Bhutto meant members of her Pakistan People's Party (PPP) did not join Saturday's opposition boycott, but abstained from voting.
Under the deal, Gen Musharraf dropped corruption charges against Ms Bhutto - a stride towards an expected power-sharing arrangement.
General elections are due to be held by mid-January.