The Trump administration challenged China to do more to pull its ally North Korea back from the nuclear brink as Secretary of State Rex Tillerson bluntly declared Friday that the United States will do whatever is necessary to prevent a North Korean attack.

“All options are on the table,” Tillerson said in Seoul, where he underscored U.S. commitment to Asian allies threatened by North Korea and said he would lean on China during a visit there Saturday.

In Washington, President Trump goaded China, which has extensive economic and political ties to North Korea but has resisted choking off the flow of money and military materials to its ally.

“North Korea is behaving very badly. They have been ‘playing’ the United States for years,” Trump wrote on Twitter. “China has done little to help!”

China has repeatedly pledged to do more, but the Trump presidency, like the Obama and George W. Bush administrations before it, accuses Beijing of going easy on Pyongyang.

A North Korean soldier takes a picture of Secretary of State Rex Tillerson from outside the window during his visit Friday to Panmunjom, the truce village on the border between South and North Korea. (Pool photo by Yonhap/via European Pressphoto Agency)

U.N. Ambassador Nikki Haley went further, telling an interviewer Friday that the Trump administration is making a sharp pivot away from what she said was an ineffectual Obama strategy regarding China and North Korea.

“There was a soft approach to China in the past presidency and what I can tell you now is we’re going to go harder on China,” Haley said on Fox News. “We’re going to say, ‘Look, if you really are wanting to partner with this, if you really are wanting to stop the nuclear testing that is going on in North Korea, prove it.’ ”

[As North Korea’s arsenal grows, experts see heightened risk of ‘miscalculation’]

At the least, the United States wants China to enforce existing sanctions on North Korea and police what U.S. officials have said are illicit Chinese business and banking deals that benefit the North Korean regime and its steadily improving missile-development program.

“We are going to go through and ask them to push towards sanctions and push towards talks with North Korea,” Haley said.

China says threats of military action by the United States or its allies South Korea and Japan, both within range of existing North Korean missiles, are unhelpful. Beijing favors further efforts to negotiate with North Korea, and hosted the last such international effort, which failed.

North Korea is known for its exaggerated and bellicose rhetoric, but the combination of threats and missile launches, coinciding with Chinese anger at South Korea for deploying an American antimissile battery, has raised tensions in the region to a level seldom seen in recent years.

Tillerson will be the first high-level Trump administration official to go to China, whose leaders were angered by Trump’s frequent bashing of Beijing over trade policies during the presidential campaign and his decision to speak with the elected leader of Taiwan in December.

Trump has tried to smooth the waters by assuring Chinese President Xi Jinping that the United States does not want a trade war and will not upend the decades-old “one China” policy regarding Taiwan, which Beijing considers a province. Trump is expected to host Xi for a visit next month at Trump’s Florida estate.

In contrast, the Trump administration has never let up on campaign-trail criticism of China over North Korea. China is also incensed by ongoing U.S.-South Korean military exercises this month and the installation of the U.S. missile defense system in South Korea.

The decision to put in the system was made by the Obama administration, and U.S. officials have always insisted it is intended solely for protection against North Korea. But Chinese officials are expected to confront Tillerson with complaints that the system could be used to spy on China.

The Chinese government is now banning many imports from South Korea and stopping Chinese tourist groups from traveling there to try to prompt Seoul to change its mind on the missile system.

Against that backdrop, Tillerson’s meetings in China probably will be the most difficult and most important of his trip.

“We will be discussing with them the serious threat that North Korea poses to peace and stability in the Korean Peninsula, but even beyond,” Tillerson said in Seoul.

The United States and its allies still have options on the spectrum between diplomatic talks and military action for persuading the North Korean regime to give up its nuclear weapons, he said.

North Korean leader Kim Jong Un said earlier this year that his country is working on an intercontinental ballistic missile capable of striking the U.S. mainland. Trump responded in a tweet: “It won’t happen!”

Tillerson has used his three-country Asian tour to underscore that the new Trump administration is fed up with years of North Korea policies that it sees as all carrot and no stick.

“Let me be very clear: The policy of strategic patience has ended,” Tillerson said at a news conference in Seoul with Yun Byung-se, the South Korean foreign minister. He was referring to the Obama administration policy of trying to wait North Korea out, hoping that sanctions would prove so crippling that Pyongyang would have no choice but to return to denuclearization negotiations.

In recent months, North Korea has been making observable progress toward its goal of building a missile that could reach the U.S. mainland.

In a surprise, Yun appeared to suggest that South Korea would support military options.

“We have various policy methods available,” said Yun, who is unlikely to remain in his position for much longer, as elections for a new government will be held in early May.

Yun likened the diplomatic effort to restrain North Korea to “a building” and said “military deterrence would be one of the pillars.”

[Here’s how a North Korean soldier got inches from Rex Tillerson]

Sanctions and diplomatic engagement so far have failed to persuade North Korea to abandon its nuclear weapons program. But U.S. administrations have long considered military action as nearly impossible because North Korea has artillery aimed at Seoul, a metropolitan area of more than 20 million people just 30 miles south of the demilitarized zone that divides the two Koreas. Thousands of U.S. troops are also within range of potential North Korean shelling or chemical and biological attacks.

Earlier Thursday, Tillerson toured the joint security area in the demilitarized zone, a spot President Bill Clinton once famously described as “the scariest place on Earth.” North Korean soldiers in helmets were taking photos of Tillerson from just a few feet away as the secretary stood at the line and inside the meeting hut.

The Korean peninsula was divided along the 38th parallel at the end of World War II, a line that was arbitrarily drawn by one of Tillerson’s predecessors as secretary of state, Dean Rusk, who was an Army colonel at the time. A reporter asked Tillerson on Friday if being at the demilitarized zone brought home the threat of North Korea, but he did not respond.

Correction: This story has been updated to correct the time when Dean Rusk drew the line across the Korean peninsula. It was at the end of World War II, not at the end of the Korean War.

Fifield reported from Tokyo.

Read more:

U.S. military deploys advanced defensive missile system to South Korea, citing North Korean threat

North Korea launches more missiles; 3 land in Japanese waters

N. Korea says it was practicing to hit U.S. bases in Japan with missiles

Today’s coverage from Post correspondents around the world

Like Washington Post World on Facebook and stay updated on foreign news