He said the electronic voting system had been hacked using the identity of a murdered IT official, with protests breaking out straight after his speech.
Two people were killed in Nairobi as they took advantage of the protests to steal, Nairobi police chief Japheth Koome said, with one being shot in the head.
Kenyan police opened fire on people protesting election results earlier in another opposition stronghold - South Mugirango constituency - killing one person.
President Uhuru Kenyatta appears headed for re-election but his rival Odinga has insisted that the results have been manipulated, ratcheting up tensions. Kenyatta was leading with 54.35 percent and Odinga had 44.77 percent after votes at more than 39,320 of the 40,883 polling stations were counted, according to the election commission. But Odinga has also published what he deems to be the true vote tally on Twitter, with himself on 8.1 million votes and Kenyatta on 7.2 million.
Riot police engaged in running battles with protesters in the opposition stronghold of Kisumu in western Kenya.
Police fired teargas as several hundred protesters in the neighbourhood of Kondele - an epicentre of violence after disputed 2007 polls - set fire to barricades and tyres and placed rocks in the streets.
'These results are fake, it is a sham. They cannot be credible,' Odinga told a press conference in the early hours of the morning as partial results fell quickly via an electronic tallying system aimed at preventing fraud.
He later detailed accusations of how hackers had gained entry to the system using the identity of top IT official Chris Msando, who was found murdered and tortured late last month. 'This is an attack on our democracy. The 2017 general election was a fraud,' said Odinga, claiming detailed evidence of the hacker's movements. He would not say how he got the information, as he wanted to 'protect his source'.
The chairman of Kenya's election commission said the allegations will be investigated.
Chairman Wafula Chebukati said an audit will probably be ordered to address concerns about the system used for yesterday's elections.