In 2013, a U.S. guided-missile ship veered sharply to avoid a Chinese navy vessel that tried to block its path in the disputed South China Sea, according to the U.S. account.
The next year, the United States said a Chinese fighter jet buzzed within 30 feet (9 meters) of one of its Navy planes, in what the White House called a "deeply concerning provocation."
They are the types of risky encounters that Beijing and Washington have sought to avoid by stepping up efforts to implement a web of military communications agreements.
But the protocols in place are mostly non-binding, contain exceptions, and at times are interpreted differently by the two sides, highlighting the risk of an unwanted escalation of tensions as the United States asserts its naval power more forcefully to counter China's maritime claims.
Washington made its most significant challenge yet to China's claims on Tuesday by sending the USS Lassen guided-missile destroyer through territorial limits China asserts around artificial islands. U.S. officials said it would be the first of regular "freedom of navigation" patrols in the area.
The agreements include the Code for Unplanned Encounters at Sea (CUES), signed in 2014 by China, the United States, and other Western Pacific nations, which sets out rules such as safe speeds and distances, the language to be used in communications, and actions in case a ship becomes disabled.
U.S. military officials say they have helped ensure there have been no further incidents as severe as those involving the USS Cowpens in December 2013 and the August 2014 jet encounter.
Chinese state media accused the U.S. ship of deliberately provocative behavior while China dismissed U.S. criticism over the warplane incident, saying its fighter pilot kept a safe distance.
But the protocols have no enforcement mechanisms and contain loopholes, military experts say. The CUES does not, for example, cover coast guard or other civilian vessels that China has increasingly used to back its vast territorial claims.
Some experts also say there is doubt in practice over whether the rules apply to all waters, or only to those recognized by both sides as international, a potential gray area highlighted by Tuesday's U.S. operation.
"I don't think we could expect these guidelines ... to suffice as an antidote to the potential for danger," said Michael O'Hanlon, a national security expert at the Brookings Institution in Washington, referring to the CUES.
"They're only designed to really avert accidents that might be caused by reckless or somewhat overly assertive navy captains in open waters," O'Hanlon said.
Further to the CUES, the United States and China last year signed a memorandum of understanding (MOU) laying out rules of behavior in air and sea encounters. A supplement to that agreement signed by both sides last month addressed everything from the correct radio frequencies to use during distress calls to the wrong physical behaviors to use during crises.
Another agreement created formal rules to govern use of a military crisis hotline, a move that aims to speed top-level communication.
Bonnie Glaser, a senior advisor for Asia at the Center for Strategic and International Studies, said the 2014 MOU applies anywhere U.S. and Chinese military naval and air assets might encounter each other.
"Of course, an aggressive operator could fail to implement them and cause an accident. There is no consequence outlined in the agreement for violating its terms," she said.
The 2014 MOU refers to military vessels' actions "at sea," implying territorial and international waters. CUES also refers to events "at sea."
"The CUES agreement addresses unplanned encounters at sea, regardless of any territorial claims," said Captain Jeff Davis, a Pentagon spokesman.
China's defense ministry declined to comment on the issue on Thursday. But China's Naval chief Wu Shengli told U.S. chief of naval operations Admiral John Richardson on Thursday that when the USS Lassen entered the disputed waters, Chinese navy ships warned the U.S. destroyer several times using CUES.
The warnings were ignored by the U.S. ship and the Chinese navy was "deeply concerned", Wu said, according to a Chinese navy statement on Friday.
Regional security analysts say China is ambiguous about precisely what it claims as territorial waters around the islands and reefs in the South China Sea.
While CUES offers guidelines for encounters between ships, the broader parameters are set by the United Nations' Convention on the Law of Sea (UNCLOS) - another area of Sino-U.S. dispute.
UNCLOS provides for countries to set 12 nautical miles from their coasts to treat as sovereign territory and a further 200 miles as exclusive economic zone (EEZ), giving them claim to any fishing or minerals on the seabed but full freedom of passage to international shipping.
One key difference between Washington and Beijing is the right of military vessels and planes to conduct surveillance in international waters seas, including an EEZ.
China has repeatedly objected to U.S. military operations off its coasts even if they are outside what it claims as its territory. Washington insists normal military activities are allowed in an EEZ under UNCLOS, including surveillance.
Despite the tensions, cooperation between the U.S. and Chinese militaries has been deepening in recent years. The two navies held high-level talks on Thursday, with both sides agreeing to maintain dialogue and the agreed protocols to avoid clashes.
As recently as February, a Chinese frigate practiced the CUES with an American combat ship. Even after the U.S. patrol this week, Chinese ships are set to visit a naval station in Florida next month, according to the U.S. Navy.
U.S. naval officers with experience of South China Sea operations in the last two years say that Chinese crews' communication and navigational understanding has improved.
"There is a professionalism that we didn't see before," one officer said, on condition of anonymity.
Use of the CUES between the U.S. and Chinese navies has lowered "the likelihood of miscalculations that could lead to dangerous escalation," said David Shear, the assistant secretary of defense for Asian and Pacific security affairs at the Defense Department, during Senate testimony in September.