Widodo, known by his nickname Jokowi, won around 53 per cent of the vote compared to about 47 per cent for Prabowo Subianto, according to a final tally cited by local media in the world's third biggest democracy.
The official announcement of the result of the July 9 election was expected shortly.
Widodo's victory caps a meteoric rise for the former furniture exporter who was born in a riverbank slum. It will be welcomed by investors who hope he can breathe new life into Southeast Asia's biggest economy after a recent slowdown.
The news came just hours after Prabowo -- who had also claimed victory in the election -- alleged fraud and said he was withdrawing from the race.
More From This Section
Prabowo, 62, had been widely expected to challenge the result in the Constitutional Court if he lost, but a spokesman for his team said this was no longer an option since they had withdrawn from the whole process.
Speaking to reporters earlier in Jakarta, Prabowo claimed there had been "a massive, structured and systematic fraud" in the 2014 elections.
"The presidential election, organised by the (election commission), is not democratic," he told reporters, adding the commission was "not fair or transparent".
Widodo however insisted that "everything was transparent, everything was open" during the election in the world's most populous Muslim-majority nation. Independent analysts have said the poll has been largely free and fair.
Tensions have risen sharply since election day as each side accused the other of seeking to tamper with the votes during the lengthy counting process across the world's biggest archipelago nation.
Security was particularly tight in the capital Jakarta, with hundreds of police in riot gear stationed around the election commission headquarters, and roads around the centre of the capital closed off to traffic.