(Adds remarks, background)
By Phil Stewart and David Brunnstrom
WASHINGTON, May 19 (Reuters) - U.S. Defense Secretary Jim Mattis said on Friday that any military solution to the North Korea crisis would be "tragic on an unbelievable scale" and Washington was working internationally to find a diplomatic solution.
North Korea has defied all calls to rein in its nuclear and missile programs, even from China, its lone major ally, calling them legitimate self-defense.
It has been working to develop a nuclear-tipped missile capable of striking the U.S. mainland, and experts say its test on Sunday of a new missile was another important step toward that aim.
"We are going to continue to work the issue," Mattis told a Pentagon news conference.
"If this goes to a military solution, it's going to be tragic on an unbelievable scale. So our effort is to work with the U.N., work with China, work with Japan, work with South Korea to try to find a way out of this situation."
The remarks were one of the clearest indicators yet that President Donald Trump's administration will seek to exhaust alternatives before turning to military action to force Pyongyang's hand.
The United States, which has 28,500 troops in South Korea to guard against the North Korean threat, has called on China to do more to rein in its neighbor.
Mattis appeared to defend China's most recent efforts, even as he acknowledged Pyongyang's march forward.
"They (North Korea) clearly aren't listening but there appears to be some impact by the Chinese working here. It's not obviously perfect when they launch a missile," Mattis said, when asked about Sunday's launch.
South Korea has said the North's missile program was progressing faster than expected, with Sunday's test considered successful in flight.
North Korea said the launch tested the capability to carry a "large-size heavy nuclear warhead," and its ambassador in Beijing has said that Pyongyang would continue such test launches "any time, any place."
Mattis acknowledged that Pyongyang had likely learned a great deal from the latest test of what U.S. officials say was a KN-17 missile, which was believed to have survived re-entry to some degree.
"They went to a very high apogee and when it came down obviously from that altitude they probably learned a lot from it. But I'm not willing to characterize it beyond that right now," Mattis said.
David Wright, co-director and senior scientist at the Global Security Program at the Union of Concerned Scientists, the big question was whether North Korea could build a re-entry vehicle for a long-range missile that wouldn't burn up during re-entry and could keep a warhead from becoming too hot in the process.
"This test in principle gave them a lot of information about this, assuming they had sensors that could send information back during reentry so they could monitor the heat, or they could recover the reentry vehicle and examine it," he said. (Additional reporting by Matt Spetalnick; Editing by Jonathan Oatis and Cynthia Osterman)