"China has repeatedly invited me. I have accepted the offer," Duterte said in a speech at the presidential palace.
Duterte gave no specific dates for visiting China, but said it would take place before he went to Japan.
The Japanese government announced today that Duterte would visit Japan from October 25 to 27.
Duterte said he had originally planned to visit Japan, the Philippines' biggest source of foreign aid, ahead of China.
More From This Section
Duterte also said that, after Japan, "probably I will go to Russia".
The trip will be Duterte's first outside of Southeast Asia since assuming the presidency on June 30, signalling the importance he places on improving relations with Beijing that had soured because of a territorial dispute in the South China Sea.
Duterte has looked to build closer ties with Russia as well as China, while launching repeated tirades against the US, the Philippines' former colonial ruler and defence ally.
His tirades have been largely in response to US criticism of Duterte's war on crime, which has claimed more than 3,300 lives.
Duterte has cancelled joint patrols with the US, said he may scrap a defence pact that allows thousands of US troops to rotate through the Philippines, and threatened to eventually cut ties completely.
Duterte has branded US President Barack Obama a "son of a whore" for expressing concern about human rights in the drug war.
"Eventually I might in my term, break up with America. I would rather go to Russia or to China. Even if we do not agree with their ideology, they have respect for the people. Respect is important," Duterte said this month.
The Philippines had long been regarded as one of Washington's most loyal allies in Asia, with the two nations bound by a mutual defence pact signed in 1951.
Duterte's predecessor, Benigno Aquino, sought to draw the US even closer in a bid to counter Chinese efforts to take control of the South China Sea.