Gen Abdulsalami Abubakar, the country’s last military head of state, voted in Minna, north-central Nigeria.
He urged those seeking office to accept the results in good faith.
Gen Abubakar said he was impressed by the large numbers who were waiting to vote.
He governed Nigeria for just under a year from June 1998. He handed power over to Olusegun Obasanjo in May 1999, after he was elected president.
This year marks 20 years since the return of democracy to Nigeria. Up until 1999, there were either short-lived civilian administrations or military rulers.