It came after unofficial tallies from polling agencies showed him leading with around 53 per cent of the vote against Prabowo's 47 per cent.
Flanked by members of his Indonesian Democratic Party of Struggle in the capital, Widodo said: "We would like to greatly thank all the Indonesian people... As well as party members who worked hard from morning to evening."
There was no immediate reaction from Prabowo.
It came after a bitterly fought campaign that saw long-time favourite Widodo's lead shrink dramatically, voters in the world's third-biggest democracy have faced a choice starkly different candidates.
More From This Section
Prabowo, a former son-in-law of Suharto who has admitted ordering the abduction of democracy activists before the strongman's downfall in 1998, has won support with promises of firm leadership in a country where many yearn for a strong figurehead.
But critics fear he may shift Indonesia back towards authoritarian rule.
Earlier, Widodo was mobbed by hundreds of journalists and supporters as he voted at a polling station near the Jakarta governor's residence in the centre of the capital.
"I'm very optimistic, and God willing we will get support from people everywhere," said the 63-year-old after voting.
"My hope is that the election went well and smoothly, with no fraud and no intimidation."
Some 190 million voters were eligible to cast ballots across the sprawling archipelago of more than 17,000 islands that spans three time zones.
Polling stations closed across the country, from eastern Papua, to the main island of Java and jungle-clad Sumatra in the west, closed at 1:00 pm and no major disruptions to voting were reported.
The Jakarta governor was targeted by smears, including a claim that he is an ethnic Chinese Christian and not a Muslim, a deeply damaging charge in the world's most populous Muslim-majority country.