Xi Jinping and President Rodrigo Duterte
In remarks that could infuriate China, Duterte hit back at domestic critics who said he has gone soft on Beijing by refusing to push it to comply with an award last year by the Permanent Court of Arbitration in The Hague, which ruled largely in favour of the Philippines.
Mr Duterte said he discussed it with Xi when the two met in Beijing on Monday, and got a firm, but friendly warning.
Mr Duterte said in a speech, recalling his conversation with Mr Xi: "We intend to drill oil there, if it's yours, well, that's your view, but my view is, I can drill the oil, if there is some inside the bowels of the earth because it is ours.
"His response to me, 'we're friends, we do not want to quarrel with you, we want to maintain the presence of warm relationship, but if you force the issue, we'll go to war."
Mr Duterte has long expressed his admiration for Mr Xi and said he would raise the arbitration ruling with him eventually, but needed first to strengthen relations between the two countries, which the Philippines is hoping will yield billions of dollars in Chinese loans and infrastructure investments.
China warned the Philippines that there will be war if they continue to drill for oil
The Hague award clarifies Philippine sovereign rights in its 200-mile Exclusive Economic Zone to access offshore oil and gas fields, including the Reed Bank, 85 nautical miles off its coast.
If it's yours, well, that's your view, but my view is, I can drill the oil
President Rodrigo Duterte
It also invalidated China's nine-dash line claim on its maps denoting sovereignty over most of the South China Sea.
Mr Duterte has a reputation for his candid, at times incendiary, remarks and his office typically backpeddles on his behalf and blames the media for distorting his most controversial comments.
Mr Duterte said he discussed it with Xi when the two met in Beijing on Monday
Mr Duterte recalled the same story about his discussion with Mr Xi on oil exploration in a recorded television show aired moments after the speech.
He said Mr Xi told him "do not touch it".
He said Mr Xi had promised that the arbitration ruling would be discussed in future, but not now.
Discover the disputed islands of the South China Sea
Wed, May 10, 2017
Among the islands at the heart of territorial disputes in the South China Sea.
1 of 6
Subi Reef at Spratly Islands: Subi Reef has transformed from a single building and cranes on an artificial sand bank to what looks look a forward operating base with its own town.
Mr Duterte said China did not want to bring up the arbitral ruling at a time when other claimant countries, like Vietnam, might also decide to file cases against it at the arbitration tribunal.
It was not the first time the firebrand leader has publicly discussed the content of private meetings with other world leaders.
The South China Sea has been a highly contentious issue between the two countries
His remarks came the same day that China and the Philippines held their first session in a two-way consultation process on the South China Sea.
They exchanged views on "the importance of appropriately handling concerns, incidents and disputes involving the South China Sea", the Chinese Foreign Ministry said in a statement that gave few details.