Philippines President Rodrigo Duterte has issued a gag order to his cabinet, barring them from publicly speaking about the South China Sea dispute.

The order came after several ministers criticized China for violating the country's maritime borders.

Duterte said Wednesday the gag order didn't mean the country was giving up in the dispute over the contested waters. He said the government remained strong in the defense of its sovereign rights.

"This is my order now to the cabinet, and to all and sundry talking for the government, to refrain from discussing the West Philippine Sea with anybody. If we talk, we talk but just among us," Duterte said.

Duterte said the order shouldn't be seen as a sign of weakness. He said maritime patrols in the contested waters would continue and he has asked agencies to continue efforts to protect and defend the country's interests.

"Our agencies have been directed to do what they must and should to protect and defend our nation's interest. We will not waver in our position," Duterte said.

Tensions between the two nations flared up in recent months after hundreds of fishing vessels from China - allegedly manned by military - were found inside the Philippines' Exclusive Economic Zone. China, which claims almost the entire South China Sea said the boats were there to escape bad weather.

While Duterte has mostly remained silent on the issue, his foreign and defense ministers have been very vocal about their opposition to China's recent maritime incursion. This includes expletive-laden posts on social media aimed at Chinese officials.

"China, my friend, how politely can I put it? Let me see...O...GET THE F*** OUT," Philippine Foreign Affairs Secretary Teodoro Locsin Jr said in a recent post on Twitter.

Locsin's post and others like it from officials prompted a rebuke from China. Locsin later apologized to his China counterparts.

Analysts said Duterte may be aiming to lessen tensions at the rhetoric level through the gag order. He likely doesn't want to elevate tensions with China any further given its significant investments in the Philippines' economic development.