“China said Vietnam should withdraw,” the president of Vietnam, Truong Tan Sang, said Friday, according to an account on the news portal Vietnamnet. “This is my house. Why do I have to withdraw.” He added, “There is no way we compromise.”

During a visit to Washington, the chief of the general staff of the Chinese People’s Liberation Army, Gen. Fang Fenghui, said Thursday, “China is unwaveringly committed to carrying out drilling activities in its own territory, lands and seas.”

“We will not brook any meddling or sabotage from outside,” General Fang added.

The contest between Vietnam and China over the oil rig has caused alarm in Southeast Asia because of the boldness of China’s move, one that is clearly intended to solidify its grasp on the South China Sea. China claims about 80 percent of those waters.

Even within China, the dispatch of the oil rig was seen as a tough signal, and analysts suggested that President Xi Jinping might have given the final go-ahead because the decision involved a state-owned company moving an extremely expensive piece of equipment and the deployment of considerable naval assets.

“The paramilitary and military forces accompanying the rig suggest this was not made by the oil company, Cnooc,” said Shi Yihong, a professor of international relations at Renmin University. “The oil company cannot deploy 80 ships. This suggests the action was decided at a very high level, and possibly by Xi Jinping.”

Mr. Shi said he was somewhat puzzled that Mr. Xi had apparently decided to pick a fight with a third country in the neighborhood in less than two years.

Since August 2012, China has waged an intense diplomatic and naval campaign against Japan over tiny islands in the East China Sea, and Beijing’s relations with another neighbor have soured over an atoll in the South China Sea that the Philippines had considered its own but which China now occupies.