KABUL—Ashraf Ghani edged closer to becoming Afghanistan's next president after winning a majority of votes in a preliminary count of last month's election, but officials stopped short of declaring a winner as millions of ballots could still be reviewed for fraud allegations.

The country's election commission said Monday that Mr. Ghani, a former finance minister, had won 56.4% of the vote in a preliminary count, against Mr. Abdullah's 43.6%.