KIEV- Ukraine's opposition leader Viktor Yanukovich headed for a slender victory on Monday in a bitterly contested presidential election but rival Yulia Tymoshenko refused to concede.
Yanukovich, 59, a beefy ex-mechanic who wants better ties with Moscow, claimed victory and called on Tymoshenko, 49, to resign as prime minister.
With almost 80 percent of votes counted, election officials gave Yanukovich 48.78 percent and Tymoshenko 45.56 percent. But Tymoshenko's camp offered a parallel count that saw her edging out her rival.
The official results appeared to cap a remarkable comeback for the rough-hewn Yanukovich, cast as the villain of the 2004 Orange Revolution when street protests overturned results that initially gave him victory in an election tainted by fraud.
The outcome could also see the country of 46 million people tilt back towards former Soviet master Russia after five years of bitter infighting and a sliding economy turned Orange euphoria into frustration and disappointment.
Both candidates pledged integration with Europe while improving ties with Moscow, but Tymoshenko is seen as more pro-Western. Yanukovich is unlikely to pursue membership of NATO, an 'Orange' goal that infuriated neighbouring Russia.
Accusing Yanukovich of cheating, Tymoshenko's team said they had counted 85 percent of votes and that she was leading by 0.8 percent, presaging a possible messy legal challenge.
Each side accused the other of fraud, but Tymoshenko stopped short of repeating a threat she made last week to call people out onto the streets if she believed the election was unfair.
I think that Yulia Tymoshenko should prepare to resign. She understands that well, Yanukovich said in a television interview. Exit polls put him three to four points ahead.
Tymoshenko was the co-architect of the 2004 revolution with pro-Western President Viktor Yushchenko, but their relationship quickly soured.
Looking stern before reporters, the fiery former gas tycoon urged her team to fight for every result, every document, every vote. The tone was moderate, and analysts said they doubted Tymoshenko could stage a repeat of 2004.
ORANGE REVOLUTION BURIED?
Legal challenges and street protests would further delay Ukraine's chances of repaying more than $100 billion (64 billion pounds) of foreign debt and nursing its sickly economy back to health after a 15 percent collapse last year.
In Russia, the source of the gas which flows through Ukraine's pipeline network to the West, the election was closely watched but state-controlled media avoided taking sides.
Sunday's vote, conducted in freezing temperatures and snow, appeared to reflect widespread disillusion among Ukrainians that the Orange Revolution failed to deliver prosperity or stability.
Yushchenko came a humiliating fifth in the first round of the election in January.
The $120 billion economy has been battered by a decline in the value of Ukraine's steel and chemicals exports that has hammered the hryvnia currency, slashed budget revenues and undermined the domestic banking system.
Voters were unenthusiastic about either candidate but seemed to feel Yanukovich, a former premier who stressed the fight against poverty, had the best chance of restoring order.
We lost five years of our lives thanks to Yushchenko and Tymoshenko, said Oleg Nochvyn, a miner in his 50s in the eastern region of Donetsk.
For five years they were promising us -- tomorrow will be better. Well, I get up the next day and it's worse than the day before ... Under Viktor Fyodorovich (Yanukovich) we had everything -- economic growth, everything was getting better.
Regardless of the outcome, squabbling was set to continue, reflecting the country's broader divisions. Ukraine is divided almost equally between a Russian-leaning east and south and a Western-friendly centre and west.
Assuming Yanukovich's victory is confirmed, Tymoshenko can expect in any case to be ousted as prime minister by a vote of no confidence in parliament.
Yanukovich will then try to form a new coalition to get his own ally into the role, or call a snap parliamentary election.
(Additional reporting by Dmitry Solovyov, Sabina Zawadzki, Yuri Kulikov and Natasha Zinets in Kiev and Lina Kushch in Donetsk; Writing by Michael Stott and Matt Robinson; Editing by Jon Hemming)