Zambia's opposition leader has accused the governing party of rigging polls as the country voted to replace deceased President Levy Mwanawasa.
Michael Sata, who claimed security forces had been intimidating voters, warned that he would not accept defeat.
But correspondents and officials said the vote had passed peacefully, while an election monitor said he had seen no evidence of rigging.
Mr Sata is standing against Zambia's acting president, Rupiah Banda.
Voters queued from early on Thursday, though polling stations in the capital, Lusaka, were reported to be quiet before polls closed at 1600 GMT.
Police had been put on high alert for what is expected to be a close vote.
The country's army commander, Gen Isaac Chisuzi, has warned that anyone trying to incite violence would be dealt with by the army.
Mr Sata had called on his supporters to sleep outside polling booths to prevent rigging.
As he cast his vote on Thursday he said there was no way Mr Banda's Movement For Multi-Party Democracy could win without cheating, accusing the police of helping rig the vote.
"I have never seen this type of panicking and this is because they have rigged the election," he said.
"It is the first time that the army commander who is supposed to protect people is predicting violence."
Asked whether he would accept a loss, he said: "No."