When the new and relatively inexperienced U.S. president met the leader of the world’s second-most powerful nation in their first summit meeting, public smiles hid the battering that the American took behind closed doors. Sized up as a lightweight by the survivor of a brutal political scene, the U.S. president confided that “he beat the hell out of me.” Worse, the impression of weakness and uncertainty the president made led directly to military challenges that nearly plunged the two countries into armed conflict.

That president was John F. Kennedy, and his antagonist was the Soviet Union’s premier, Nikita Khrushchev. They met in Vienna in June 1961. This was just months after Kennedy had taken office, and he was subjected to a relentless attack by the seasoned and wily veteran of Stalin’s court. Kennedy and his aides were shaken by the encounter, and it showed. Despite America’s overwhelming position of economic and military strength, Khrushchev came away convinced not merely that Kennedy was all talk and no action, but that he didn’t have the spine to counter Soviet aggression. Within months, Moscow had given orders to build the Berlin Wall, and U.S. and Soviet tanks faced each other across Checkpoint Charlie. The following year, Khrushchev sent nuclear-tipped ballistic missiles into Cuba, precipitating an American naval quarantine and bringing the world to the brink of nuclear war.

When Donald Trump meets Xi Jinping in Mar-a-Lago, Florida, on Thursday, could a similar dynamic play out? Not a nuclear face-off, to be sure; America doesn’t have the adversarial relationship toward China that it had toward the Soviet Union in the Cold War era. But could Xi come away with a similar calculation that despite his tough talk on trade and the South China Sea, Trump is less than meets the eye, and will blink if tested?

The parallels are certainly there, starting with the inexperience of the president and the willingness of the Chinese leader to gamble by pushing the Americans. Just as Khrushchev believed of his country, Xi apparently believes that time is on China’s side, despite clear evidence of mounting economic problems at home. And like their Soviet predecessors, today’s Chinese believe that American society is too soft to commit to a long-term competition around the globe.

Perhaps most intriguingly, both summits circle around issues of allied states (East Germany in 1961 and North Korea in 2017) as well as questions of freedom of access (East Berlin back then and the East China Sea today).

Unlike Kennedy, however, Trump has given Xi reasons to believe he is not fully committed to America’s postwar role in the world. The second most famous line from Kennedy’s inaugural address proclaimed that America “would pay any price, bear any burden … support any friend and oppose any foe to assure the survival and the success of liberty.” By contrast, Trump declared in his that “from this moment on, it’s going to be America First.” While the former may have led to mistakes such as the Bay of Pigs, the latter may lead to an America less willing to act to maintain stability in strategic spots around the globe.

Trump’s America First rhetoric alone might have encouraged Xi to see how far the president can be pushed; the wide swings in Trump’s policy toward China may embolden the Chinese leader even further. What started out as a surprisingly hard line against China during the campaign and transition into office has significantly softened in the two months since he took office, leading to charges that Trump has flip-flopped or caved to Chinese pressure. In the days leading up to the summit, the president again took a harder line.

Candidate Trump came to prominence in the Republican primaries in part by promising a trade war with China, and further dug in his heels after the election by talking with Taiwan’s president, Tsai Ing-Wen, and raising doubts as to whether he would follow the traditional “One China” policy. By contrast, President Trump once in office made a quick about-face. Not only did he reiterate his intention to honor the One China policy in his first phone call with Xi, his administration has made no moves to label China a currency manipulator or to impose punitive tariffs.

The one trade move that Trump did make—withdrawing from the Trans-Pacific Partnership—is a boon to Beijing’s efforts to forge its own Asian free trade agreement. And while it may simply be Chinese dezinformatsiya, rumors have been floated that, at the instigation of Henry Kissinger, Trump might sign a so-called “fourth communique” with Xi that formally enshrines the One China policy recognizing Taiwan as part of China, and possibly might even agree to limiting arms sales to Taipei. Whether done in Mar-a-Lago or down the road, such an agreement would be a blow to the slow but steady evolution in Taiwan toward a more independence-oriented mindset, which is exactly the outcome that Beijing wants.

All this might lead Xi to think he can bully Trump the way that Khrushchev bullied Kennedy. If Xi wants to, there a number of things he can do to test Trump’s resolve, beyond pushing for a fourth communique on Taiwan. One would be to get Trump himself to agree to Chinese formulations of Sino-U.S. relations as ones of “mutual respect,” meaning respecting core interests like Taiwan, or “win-win” cooperation, whereby difficult issues like cyberattacks are shelved. Such were the statements made by Secretary of State Rex Tillerson on his recent trip to Beijing, which were eagerly trumpeted by the state-run press. If Trump mouthed the same phrases, it would give the appearance of a U.S. president essentially accepting China as an equal, if not dominant, power in Asia.

Xi could try to test Trump beyond mere rhetoric. For example, he could declare an “air defense identification zone” over the South China Sea, like the one Beijing established over the East China Sea in 2014. While this would not likely change American military activities in the region, it would force Trump to respond—or seem to be acquiescing to the extension of China’s control in an area where multiple nations claim territorial rights. Alternatively, Xi could begin militarizing the Scarborough Shoal, which China in essence seized from the Philippines in 2012, further cementing its military predominance in the South China Sea. Even more provocatively, Xi could deploy fighter squadrons and anti-air and anti-ship missiles to other disputed islands. That would put China in a largely unassailable position in what is perhaps the world’s most vital waterway, and make American claims about protecting the high seas seem like empty proclamations.

Xi could be even more convinced he can get away with some or all of these activities because the Trump administration is still largely bereft of high-ranking political appointees fit to make Asia policy. Two months into Trump’s term, no assistant secretary of defense or state for Asia has even been announced, let alone formally nominated. Asia policy is in stasis, and there are reports that the White House is loath to approve freedom of navigation operations in the South China Sea as a signal to Beijing. All this means that Trump needs to be ready to blunt any attempt by Xi to back him into a corner, unless he wants to spend the rest of his term digging himself out.

The biggest danger, however, is that Xi will misread Trump. Xi may well think there is a window of opportunity to increase China’s power and influence at the expense of an untested and distracted American president. And without a full team to offer suggestions, Trump might hesitate in responding, seemingly vindicating Xi’s judgment. But both men would be wise to remember the rest of the lesson from Vienna.

As the Berlin crisis unfolded in the summer of 1961, Kennedy seemed to accept Moscow’s sphere of influence over East Berlin, thus encouraging Khrushchev to go ahead with building the wall. And once the Americans acceded to that, sending missiles into Cuba seemed less a gamble worth taking. Finally, Kennedy and his advisers held the line. The Soviets had made a huge miscalculation, one that not only significantly damaged Moscow’s reputation, but also could have triggered an all-out confrontation between the superpowers. It led to Khrushchev being ousted by Leonid Brezhnev two years later.

Of course, 2017 is not 1961, and it’s hard to imagine a scenario in which American and Chinese forces wind up in unrestrained battle against each other. But that doesn’t mean that miscalculation, accident, fear, and opportunism won’t form a toxic brew that ensnares both sides. First impressions are vital, and as they sit down in Florida, Trump would do well to remember what happened to Kennedy in Vienna, just as Xi would do well to remember what happened to Khrushchev in Cuba.