About the same time that China's defense chief was clinking wine glasses with Manila's military brass in May, three Chinese navy ships were erecting a steel post about 180 miles (290 kilometers) offshore to fortify their claim to a reef in the disputed South China Sea, according to a Philippines military report.
A recent series of flare-ups over the possibly resource-rich waters raises an age-old question for China's smaller Southeast Asian neighbors: Is China more a friend, with all the benefits that trade and aid is bringing, or more a foe?
The stakes appear to be rising. Both Vietnam and the Philippines accused Chinese ships of interfering with energy exploration efforts this year. Earlier incidents typically involved harassment of fishing boats in the contested waters.
It's unclear what sparked the uptick in confrontations, but one factor may be China pushing back against what it sees as U.S. interference in the disputes, as the two powers become rivals in the Pacific. The South China Sea is a vital shipping lane that the U.S. Navy patrolled virtually uncontested for decades.
Twice since May, Vietnam says, China cut cables used by its ships to conduct seismic tests of the sea bottom. In March, two Chinese naval ships threatened a Filipino ship exploring for gas in an area known as Reed Bank. China hasn't admitted cutting cables but acknowledges incidents took place and says they were in its waters.
The confrontations are testing the ability of both countries to maintain good relations with China while standing up to its growing naval power and territorial claims.
Though the skirmishing at sea appears to have ended amid a flurry of diplomatic activity, the underlying issues remain unresolved and are a likely source of friction at an Asian security forum in Bali, Indonesia, this month.
"I think the thermostat is being set," said Carlyle Thayer, a Vietnam expert at the University of New South Wales in Australia who studies the South China Sea disputes. "We now have to see if the tensions will cool down. If it doesn't work, then we're in for trouble."
The sparring is over the Spratlys, nearby Paracels and Scarborough Shoal, a slew of tiny, mostly uninhabited islands, some no more than a half-submerged coral reef and surrounding waters. China claims the entire area, a large swath extending far from its southern coast and overlapping with the 230-mile (370-kilometer) exclusive economic zones of the Philippines and Vietnam and, to a lesser degree, of Malaysia, Brunei and Taiwan.
The United States irked China last year by asserting that Washington had a national security interest in the peaceful resolution of the disputes.
"I believe that individual countries are actually playing with fire, and I hope that fire will not be drawn to the United States," Chinese Vice Foreign Minister Cui Tiankai warned last month.
China has called for bilateral negotiations to solve the disputes, a strategy that would effectively shut out the U.S. or ASEAN, the Association of Southeast Asian Nations. Its smaller neighbors favor a multilateral approach to give them more clout.
There have been 11 reported incidents this year, including the three that targeted oil and gas exploration, according to the Philippines and Vietnam. They began in late February and continued through June. Both countries responded by deploying armed escorts to protect their explorations.
Philippine President Benigno Aquino III told The Associated Press in June that the exploration at Reed Bank, about 90 miles (150 kilometers) from the Philippine coast, has been completed and turned up "very good" prospects.
Beijing accuses the two countries of encroaching on its territory and undermining China's interests. Liu Jianchao, the Chinese ambassador to Manila, warned last month that any oil exploration in the region should not proceed without Beijing's permission. He held out the possibility of joint exploration with China.
Alarmed by what some officials describe as a creeping invasion, the Philippines and Vietnam swapped diplomatic protests with Beijing and launched live-fire drills with U.S. forces near the disputed waters.
In Vietnam, dozens of people took to the streets of Hanoi and Ho Chi Minh City in recent weeks in rare anti-Chinese protests tolerated by the communist state, although on Sunday police broke up a demonstration and detained protesters and journalists.
Aquino dispatched his top diplomat, Albert del Rosario, to Washington last month to clarify if U.S. forces could be summoned under a 1951 Mutual Defense Treaty if Filipino troops or ships came under attack.
Secretary of State Hillary Rodham Clinton responded that the U.S. would honor the treaty. Washington also agreed to provide patrol ships and coast monitoring equipment at a reduced cost.
"If we allow ourselves to be pushed around, maybe tomorrow our 7,100 islands would be down to just two digits," Aquino told Filipino diplomats last week. He and others began referring to the South China Sea as the "West Philippine Sea."
On Sunday, Adm. Mike Mullen, chairman of the U.S. Joint Chiefs of Staff, reiterated U.S. support during a visit to Beijing. "The U.S. is not going away," he said.
Despite the tough words, analysts say major violence is unlikely, though they don't rule out limited clashes. The region has become dependent on China as an investor, provider of aid and a market.
Vietnamese and Chinese officials agreed last month to treat the dispute "through negotiations and peaceful, friendly consultations."
Del Rosario, the Philippines' diplomat, and Chinese Foreign Minister Yang Jiechi pledged in Beijing last week to keep the disputes from affecting their countries' broader relations. Del Rosario said: "We agreed to disagree."
Associated Press writer Margie Mason in Hanoi contributed to this report.