Beijing deployed the massive rig in early May close to the Paracel Islands, triggering a furious reaction in Hanoi and the most serious uptick in tensions in the waters in years.
Hanoi demanded Beijing withdraw the rig, and sent ships to the region to try and disrupt the operations. The Chinese move triggered protests in Vietnam and deadly anti-Chinese riots. Beijing insisted it had done nothing wrong because the waters belonged to it.
The official Xinhua News Agency said Wednesday that the China National Petroleum Corp on Tuesday announced the end of the operation, citing the beginning of the typhoon season. It said the rig would be relocated to operations close to China's Hainan Island.
Ha Le, deputy director of Vietnam's fisheries resources surveillance department, said China began removing the rig and escorting vessels Tuesday night, and by 8 am Wednesday it was 40 nautical miles northwest of its original location and continuing to move toward Hainan island.
"We don't know what will China do next following the removal of the Haiyang Shiyou oil rig 981," Mr Le said. "We will monitor the situation in the East Sea closely and be ready with other law-enforcement agencies to defend our sovereignty," referring to the South China Sea.
Mr Le said 30 vessels from Vietnam's coast guard and fisheries patrol forces that were sent to try to force the Chinese oil rig away will return to port to avoid the incoming Rammasun typhoon.
The Xinhua report said the company found oil and gas during the operation, but was assessing the data gathered before deciding its next move.
It has always been unclear whether the Beijing deployed the rig for genuine commercial reasons or as part of strategy of staking out its territorial claims in the region. When it announced the deployment, Beijing said it would withdraw it on Aug 15.
The deployment of the rig was seen as a highly provocative move by China, which it claims nearly all of the South China Sea, bringing it into conflict with Vietnam, the Philippines and other nations.
Beijing's growing economic and military might is unnerving many countries in the region, as well as the United States, which is seeking closer ties with Southeast Asia to try to contain China.
The United States criticised the rig placement "as part of a broader pattern of Chinese behaviour to advance its claims over disputed territory in a manner that undermines peace and stability in the region."