Philippine President Rodrigo Duterte, fourth from left, speaks with his generals upon arrival in the town of Talavera on April 5, 2017. (King Rodriguez-Ho Handout/EPA)

The Philippine president appeared to revive his quarrels with China on Thursday, ordering his troops to occupy islands and reefs in the disputed South China Sea — and saying he may even stop by for a visit.

Rodrigo Duterte said the military should build structures on all of the Philippine-held islands, reefs and shoals in the contested Spratly Islands — not far from seven man-made Chinese islands in the area.

China’s construction of the islands is part of its claims of territorial sovereignty over nearly the entire South China Sea, an important route for sea trade across Southeast Asia. Neighboring nations strongly oppose Beijing’s moves and worry that the runways and docks on the artificial islands could eventually serve a military purpose.

Since winning the presidency last summer, the bombastic Duterte has struck a surprisingly conciliatory tone with Beijing, playing down a landmark ruling that rejected Chinese maritime claims and signaling that he was willing to work with Beijing in return for Chinese investment.

It is not clear whether Duterte was making a policy statement on Thursday or another of his high-stakes quips, which have included mocking figures such as then-President Barack Obama and Pope Francis.

(Jason Aldag,Julie Vitkovskaya/The Washington Post / Satellite photos courtesy of CSIS)

It could suggest, however, that Duterte is returning to his confrontational stance with China after powerful domestic critics questioned his light-touch approach toward Beijing.

Duterte also mentioned that he would like to plant a flag on one island for Philippine Independence Day on June 12.

“It looks like everybody is making a grab for the islands there, so we better live on those that are still vacant,” he said.

“At least, let us get what is ours now and make a strong point there that it is ours,” he added.

When Duterte was campaigning for president, he once quipped that he would “ride a Jet Ski” to the Spratly Islands to plant a flag. Later, he mocked the press for taking his claim seriously.

Regardless of whether he is serious, Thursday’s remarks are sure to unnerve Beijing, which claims the Spratlys and other disputed South China Sea islands and has been working diligently to get Duterte on its side.

Duterte’s latest comments are strikingly at odds with what he and members of his cabinet have been saying.

Just two days ago, acting foreign secretary Enrique Manalo said the Philippines, China and neighboring countries were making progress on a new code of conduct for the South China Sea.

When Duterte visited Beijing last fall, he secured loans and deals worth billions of dollars. In a speech in the Chinese capital, he derided Americans, called for a “separation” from the United States and said he hoped to align himself with China’s “ideological flow.”

Though Duterte enjoys considerable popular support, much of the military and political elite is wary of working with China — they don’t much like its ideology, or its maritime claims.

When Defense Secretary Delfin Lorenzana recently raised concerns about Chinese ships surveying an area off the Philippine coast known as Benham Rise, Duterte brushed the critique aside — and was later forced to backtrack.

Duterte’s office has since suggested changing the name from “Benham Rise” to “Philippine Rise” or “Philippine Ridge” in an apparent nod to patriotic sentiment.

Richard Javad Heydarian, an assistant professor of political science at Manila’s De La Salle University, said Thursday’s comments were meant to calm nerves within the defense establishment.

“He definitely felt the heat, so is now scrambling to rebuild his patriotic credentials,” Heydarian said.

If Duterte were to push ahead with the deployment or the visit, he would surely face fierce resistance from Beijing. But experts stressed that the plan would be next to impossible to implement and could hurt the standing of the Philippines.

“There are no islands left to occupy, and we filed and won a case against China for occupying reefs,” said Jay L. Batongbacal, director of the Institute for Maritime Affairs and Law of the Sea at the University of the Philippines.

“He’s playing to the galleries,” Batongbacal said.