China and Vietnam have agreed to negotiate territorial and border disputes in the hotly contested South China Sea. This announcement comes just one day after Lê Hong Anh, a senior Vietnamese Communist Party official, Politburo member, and haver of impressive eyebrows, met with Chinese President Xi Jinping in Beijing.

Anh arrived in China three days ago as the special envoy of Nguyen Phu Trong, the chief of Vietnam's Communist Party, and at the invitation of the Chinese Communist Party. The invitation was issued as part of a bid to repair relations between the two countries after a summer of clashes at sea over disputed territory.

This visit to China comes shortly after the August 14 visit to Vietnam of US General Martin Dempsey, the Chairman of the Joint Chiefs of Staff (CJCS) — the first visit by a CJCS since 1971, when the two countries were still at war. Dempsey reportedly met with several senior Vietnamese defense officials, including his counterpart, Lieutenant General Do Ba Ty, to discuss the forging of a closer defense relationship between the two countries. Dempsey said that if the US lifts its embargo on the sale of weapons to Vietnam, he would recommend deals that strengthen the Vietnamese Navy — a noteworthy statement given both Vietnam's maritime disputes with China and the rapid growth of China's Navy.

Dempsey's visit, in turn, came just one week after US senators John McCain and Sheldon Whitehouse visited Vietnam, where McCain was held as a prisoner of war for more than five years. He is now promoting closer ties that would include further military cooperation and visits by US Navy ships.

This string of high-level meetings followed a summer of heightened tensions between China and Vietnam over a disputed portion of the South China Sea, which led to rioting against Chinese-owned businesses in Vietnam and the self-immolation of a Vietnamese woman protesting Chinese actions. Internationally, Vietnam has pursued a much warmer relationship with the Philippines, which is itself embroiled in an increasingly tense dispute with China over the South China Sea.

There are a number of different ways to parse the activity that led up to the agreement between Vietnam and China. It could be that after meeting with the US, Vietnamese officials felt they weren't guaranteed enough support to weather a complete rupture of their relationship with China. Alternately, the meetings with the US could have been a move to strengthen Vietnam's negotiation position by reminding China that Vietnam is warming to powerful potential military allies. Or, negotiating with China in the short term could be part of a longer-term strategy to bide time while building alliances and arming for the long term.

It's not easy to definitively assert what exactly is going on in Vietnam, or how all of this maps onto their internal politics. But no matter what's going on, the complex politics embroiling the South China Sea aren't going to resolve neatly or quickly.