GettyImages-52745860
A stack of scrapped missiles, the South Korean Nike (L, back), the US Hawk (front) and the North Korean Scud (C, back) displayed at a war museum in Seoul, South Korea, May 2, 2005. Getty Images

Chinese officials had a dire warning Wednesday for the United States and South Korea amid increasing tensions with North Korea. Chinese Foreign Minister Wang Yi urged the U.S. and South Korea to end their joint military exercises and told North Korea to stop launching banned missiles if the three nations wanted to avoid an all-out war.

“The two sides are like two accelerating trains coming toward each other, with neither side willing to give way,” Wang told the National People’s Congress in Beijing Wednesday. “The question is: Are the two sides really ready for a head on collision? Our priority now is to flash the red light and apply brakes on both trains.”

GettyImages-508888802
People walk past a display of model missiles including a North Korean Scud-B at the War Memorial of Korea in Seoul, South Korea, Feb. 7, 2016. Getty Images

There has been no shortage of threats from either side of the conflict. North Korea warned of “actual war” with the U.S. and South Korea when the two started annual joint military exercises this month. The U.S. also began deploying its missile defense system, the Terminal High Altitude Area Defense system (THAAD), to the Osan Air Base in South Korea, drawing the ire of its counterpart to the North. The system was expected to become operational as soon as April.

North Korea, for its part, launched a number of banned missiles into Japanese waters Monday and has been testing others in violation of international laws. In a show of loyalty to Japan, the U.S. Air Force sent 14 C-130J planes, its “meanest, toughest, most tactical machine[s]” to Tokyo the same day.

Stopping all of these efforts would “bring the parties back to the negotiating table,” Wang said, calling China the “switchman” who would “switch the issue back onto the track of seeking a negotiated settlement.”

“We have to walk on both legs, which means not just implementing sanctions, but also restarting talks,” he added.