SEOUL - South Korea’s security alliance with the United States has provided the country with tremendous benefits for decades.

It remains hugely popular among the South Korean public, which likely explains why the left-leaning Moon Jae-in administration has been so accommodating of US policy under the erratic Donald Trump administration.

But as Washington squares off against a rising and assertive Beijing, Seoul is stuck in a precarious middle between its only strategic ally and its leading trade partner. It is a fight many in Seoul’s corridors of power would prefer not to take sides considering the political risks and economic costs.

Those risks are steeped in history. Communist China made it shockingly clear its sensitivity to US troops on its periphery in October 1950. That month, the Chinese People’s Volunteers Army made a shock intervention in the Korean War - routing advancing US-led forces and rescuing a collapsing North Korea.

North Korea endured and has since acted as a buffer on China’s northeastern frontier against democratic South Korea, the troops of its US ally, and the more distant Japan.