Ukraine's Supreme Court has rejected an appeal by Viktor Yanukovych against the electoral commission's handling of last month's re-run presidential poll.
Viktor Yanukovych says he is losing hope of being declared president
The ex-prime minister had wanted the court to make the commission re-examine complaints about the election.
The results - yet to be confirmed by the commission - show his rival Viktor Yushchenko won by two million votes.
The Supreme Court ruling means Mr Yanukovych still has one more chance to appeal against the outcome.
On Wednesday, outgoing President Leonid Kuchma accepted Mr Yanukovych's resignation as prime minister.
Mr Yanukovych, who had been in the job since November 2002, stepped down on 31 December.
The president's office said Finance Minister Mykola Azarov would take over as acting prime minister.
The presidential poll was re-run on 26 December after Mr Yushchenko and independent observers alleged extensive vote-rigging in the original poll, which Mr Yanukovych was said to have won. The Supreme Court had upheld their complaints of massive fraud.
Preliminary final results from the fresh elections show Mr Yushchenko with an 8% lead over the prime minister.
However, Mr Yushchenko cannot be formally pronounced a winner until his rival exhausts all legal possibilities to challenge the election results.
The commission rejected an appeal by Mr Yanukovych to invalidate the results in all 225 Ukrainian constituencies on a number of grounds, including abuses at polling stations.
Announcing his resignation in a television broadcast on New Year's Eve, Mr Yanukovych said that while he planned to challenge the results, he could not work with people loyal to Mr Yushchenko.
The Ukrainian parliament passed a vote of "no confidence" in Mr Yanukovych's government on 1 December, but Mr Kuchma refused to sign the final decree which would have dismissed him.