The U.S. on Wednesday praised China's removal of an oil rig from disputed waters in the South China Sea, two months after its placement near the Paracel Islands sparked tensions with Vietnam.

Beijing says that after finding signs of oil and gas in waters claimed by both countries, the rig is being towed to the Chinese island of Hainan a month ahead of the announced end-date for drilling.

State Department spokeswoman Jen Psaki Wednesday said the U.S. wants the issue resolved diplomatically.

"The oil rig incident has highlighted the need for claimants to clarify their claims in accordance with international law to reach a shared understanding on appropriate behavior and activities in disputed areas," said Psaki.

A 2002 Code of Conduct for the South China Sea, between China and the Association of Southeast Asian Nations (ASEAN), should be the guiding document, Psaki added.

Moving the rig may, in part, be weather-related. Typhoon season has sent several storms through Southeast Asia already.

But the relocation still has political ramifications, says Carl Thayer, a security analyst with the Australian Defense Force Academy and a South China Sea expert. Primarily, he says, the move keeps the issue a bilateral one between China and Vietnam.

"It's to influence the debate in Hanoi, to prevent Vietnam from taking legal action against China as has been threatened, and to prevent Vietnam from aligning or stepping up its security cooperation with the United States," said Thayer.

Hanoi on Wednesday called the rig's placement "completely illegal" and demanded China not repeat the act.

Duong Danh Dy, a former Vietnamese diplomat to China, said in an interview with VOA's Vietnamese service that while Hanoi will never compromise its sovereignty, it will look for ways to peacefully settle the issue with Beijing.

"It's more likely that Vietnam will seek ways to ‘be in peace’ with China. Nevertheless, it’s really hard to have long-term peace with China. It’s not over yet, China will have further acts. It’s really hard to be China’s neighbor," said Dy.

Wang Zhen, of the China National Petroleum Corporation, has said the repositioning was a logistical decision. He said prospecting went as planned despite opposition from Hanoi.

"During the operation, as we've seen from the media reports, Vietnam held a series of protests and made disruptions. We oppose their actions from the angle of production. But we pushed forward our plan smoothly as scheduled and completed the task on time," said Zhen.

Boundary disputes in one of the world's most heavily navigated waterways created solidarity in recent months between Japan, the Philippines, and Vietnam, which all challenge China's maritime claims.