Niger opposition leader Mahamadou Issoufou won Saturday's presidential run-off with nearly 58% of the vote, the election commission has announced.
Mr Issoufou had been defeated in two previous polls by former President Mamadou Tandja, who was ousted by the military a year ago.
The presidential candidate for Mr Tandja's MNSD party, ex-premier Seini Oumarou, received about 42% of ballots.
The election is intended to return Niger to civilian rule.
Social Democratic Party leader Mr Issoufou, 59, was the favourite going into the run-off, having led the first round of voting in January.
'Example to Africa'
The army, which has pledged to step down by April, said before the ballot that it was not backing either candidate.
Mr Tandja spent 10 years in power before being overthrown in a military coup in February last year when he tried to overstay his legal term limit.
The former president is currently in prison facing charges of corruption.
General Salou Djibo, who has led the junta since its largely popular coup, hailed Saturday's peaceful vote as an example to the rest of Africa.
Turnout was about 48%.
Niger, a largely desert nation in West Africa, has reserves of uranium and has attracted billions of dollars of investment.
It remains one of the world's poorest nations, and has witnessed a number of coups since independence from France in 1960.
Al-Qaeda has been blamed for a spate of kidnappings and killings of Westerners in the region in recent years.