Defense Secretary Jim Mattis on Wednesday said diplomatic solutions are still on the table when it comes to North Korea, after he was asked to respond to a tweet by President Trump that said "talking is not the answer."

"No, we are never out of diplomatic solutions," Mattis said in a brief interchange with pool reporters before meeting with his South Korean counterpart Song Young-moo in the Pentagon. "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."

Earlier in the morning, Trump tweeted that "The U.S. has been talking to North Korea, and paying them extortion money, for 25 years. Talking is not the answer!"

Trump appeared to be signaling that the administration was shifting tactics a day after a White House statement said "all options are on the table." Mattis and Secretary of State Rex Tillerson have repeatedly said the top priority should be a diplomatic solution with North Korea.

On Monday, North Korea launched an intermediate-range ballistic missile, which flew over Japan before hitting the Pacific Ocean east of Japan.

North Korea leader Kim Jong Un remains defiant in the face of U.S., U.N. and international demands that he halt missile testing and the continued development of nuclear weapons.

The state-run Korean Central News Agency quoted Kim as calling Monday's missile launch "a curtain-raiser" and "the first step of the military operation" aimed at "containing Guam."

U.S. Ambassador to the U.N. Nikki Haley called the test "absolutely unacceptable and irresponsible," noting that North Korea has violated "every single security council resolution we have had."

Mattis made the comment during a media availability before the meeting, in which a reporter is allowed to ask a question on behalf of the press corps, which is then distributed to news outlets. Photographers and videographers are also allowed in.

After initially saying "no" after being asked whether the U.S. was out of diplomatic solutions, the reporter pressed Mattis over what options can still be taken.

"Now you're testing us here, you know," Mattis joked. "We bring you up here to take pictures."