The hostages, who had been held since March 26
, were in "good condition," and were expected to arrive in Jakarta on Sunday night, he said.
Widodo thanked the Philippines government and the various parties who helped secure the release of the hostages.
Four Indonesians were still being held, and the Indonesian government would continue to work to secure their release, he said.
Officials in Sulu province in the southern Philippines released photographs of the men having a meal after being released.
The sailors were abducted from the Brahma 12 tugboat and the Anand 12 barge in the waters off the southern Philippines in March. The barge was carrying 7,000 tons of coal.
A person claiming to be a member of the Abu Sayyaf Islamist group contacted the ship owners demanding a ransom, Indonesian officials said.
Focus on kidnappings
Abu Sayyaf also made headlines for the killing of Canadian John Ridsdel
Ridsdel had been held hostage along with three others since they were abducted from a resort in the southern Philippines in September last year.
The others, Norwegian national Kjartan Sekkingstad, Canadian national Robert Hall and Filipina Marites Flor remain in Abu Sayyaf's custody, according to officials.
The violent extremist group seeks to establish an independent Islamic state on Mindanao
, the southernmost major island of the predominantly Catholic Philippines.
The Philippines military has made inroads in recent years in thwarting the group's terrorist bombing campaigns, prompting a shift in focus by the group to kidnappings for ransom.
Greg Poling, director of the Asia Maritime Transparency Initiative at the Washington-based Center for Strategic International Studies, said last week that "after about 15 years of a pretty harsh crackdown by the U.S. and the Philippines, what they've basically become is a criminal group made up of a few hundred who engage in extortion and kidnapping."