North Korean state television released images of a ballistic missile that flew over the northern Japanese island of Hokkaido on Aug. 29. (Reuters)

President Trump on Wednesday questioned why the United States should keep open the possibility of talks with North Korea, hours after the U.S. military conducted a new missile-defense test off the coast of Hawaii that it said was successful.

The test came after North Korea launched a ballistic missile over northern Japan early Tuesday and warned that it was the first step in having a “Pacific operation.” Late in the day in Hawaii, the Navy and the Missile Defense Agency combined to carry out what they termed a “complex missile defense flight test,” intercepting a mock medium-range ballistic missile using guided missiles launched from the destroyer USS John Paul Jones.

The military used what it calls “Standard Missile-6″ weapons to take out the ballistic missile target, tracking it on radar aboard the ship first. Lt. Gen. Sam Greaves,  director of the Missile Defense Agency, said in a statement afterward that it was working with the Navy “to develop this important new capability,” and considered the test a key milestone in building the Navy’s Aegis missile-defense capability.

“We will continue developing ballistic missile defense technologies to stay ahead of the threat as it evolves,” Greaves said.

Trump accused North Korea of taking “extortion money” from the United States for the past 25 years in a tweet several hours later, adding that “Talking is not the answer!” The president posted the message as Defense Secretary Jim Mattis was preparing to meet Wednesday morning with Song Young-moo, South Korea’s defense minister.

Mattis, asked Wednesday morning at the Pentagon whether there are no diplomatic solutions when it comes to North Korea, indicated that there still are.

“No, we’re never out of diplomatic solutions,” he said. “We continue to work together, and the minister and I share a responsibility to provide for the protection of our nations, our populations and our interests, which is what we are here to discuss today.”

After President Trump tweeted on Aug. 30 that "talking is not the answer," Defense Secretary Jim Mattis denied that the United States was out of diplomatic solutions with North Korea. (Reuters)

The test, carried out off the coast of Hawaii, marks the second time that the military has successfully intercepted a medium-range ballistic missile target, military officials said. The first one occurred in December.

Following closed-door deliberations Tuesday, the United Nations Security Council unanimously condemned the North Korean launch but stopped short of calling for additional sanctions.

Envoys from Japan and Britain backed additional penalties on Wednesday, despite likely opposition from veto-holding powers China and Russia. In the past, the United States has worked with China to draft economic penalties that China, which is responsible for about 90 percent of North Korean international commerce, can support. The latest, and strictest, penalties were imposed with a unanimous vote on Aug. 5, but China has not signaled that it is prepared to go further now.

British U.N. Ambassador Matthew Rycroft told reporters Wednesday that one potential target could be further restrictions on payments involving North Korean laborers employed abroad.

Japanese U.N. Ambassador Koro Bessho said Tokyo wants to follow up with a “strong resolution,” and said the country would take up the issue of further sanctions with the United States.

A day after North Korea launched a missile over Japan, Tokyo Bureau Chief Anna Fifield answers one of the questions she gets most often about North Korea: "Are we going to war?" (Anna Fifield/The Washington Post)

Navy Adm. Harry Harris, chief of Pacific Command, has suggested that the Pentagon should consider adding more ballistic missile interceptors in Hawaii, citing the threat North Korea poses. There are “sufficient” ballistic missile interceptors protecting the United States at Fort Greely in Alaska and Vandenberg Air Force Base in California, he said, but more equipment in Hawaii could be helpful.

“I believe that our ballistic missile architecture is sufficient to protect Hawaii today, but it can be overwhelmed,” Harris said in April during a House Armed Services Committee hearing. If the United States faced a wave of incoming ballistic missiles, he added, “someone would have to make a decision on which one to take out or not. So that’s a difficult decision.”

Anne Gearan contributed to this report.