Sunday's test "shows why we are working so closely right now with the Chinese, coming out of the Mar-a-Lago meeting" in Florida between the two nations' leaders earlier this month, Mattis told reporters.
The American-Chinese effort seeks to "get this under control and aim for the denuclearised Korean peninsula" desired by China, the US, South Korea and Japan, he said as he flew to the Middle East for a tour.
"We all share that same interest."
North Korea missile test fails before Pence visit
North Korea has defied international pressure over its quest to develop a nuclear-tipped ballistic missile capable of reaching the US mainland.
American officials said the missile test-fired on Sunday exploded seconds after launch.
North Korea still has many technical problems to resolve, but the intensity of its current testing worries Pentagon strategists.
UN Security Council strongly condemns North Korea missile test
Estimates vary about how much time Pyongyang would still need to build intercontinental ballistic missiles, but some at the Pentagon think it could happen within two years.
Others believe several more years might be needed, noting the difficulty of designing and testing the warhead.
This component, which contains the nuclear bomb, must be able to resist the enormous heat and shock accompanying its atmospheric re-entry after being fired into space.
Mattis arrived on Tuesday in the Saudi Arabian capital Riyadh, his first stop on the Middle East tour that will also see him visit Egypt, Israel, Qatar and Djibouti in the Horn of Africa.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ