* N.Korea says it tested intercontinental ballistic missile
* N.Korea says its missiles can hit anywhere on Earth
* Missile launch comes just days ahead of G20 summit
* Japan's Abe says N.Korea ignoring repeated warnings
* Trump: "Perhaps China will put a heavy move on North Korea" (Adds Chinese, analyst comment)
SEOUL, July 4 (Reuters) - North Korea said on Tuesday it successfully test-launched an intercontinental ballistic missile (ICBM) for the first time, which flew a trajectory that experts said could allow a weapon to hit the U.S. state of Alaska.
The launch came days before leaders from the Group of 20 nations were due to discuss steps to rein in North Korea's weapons program, which it has pursued in defiance of U.N. Security Council sanctions.
The launch, which North Korea's state media said was ordered and supervised by leader Kim Jong Un, sent the rocket 933 km (580 miles) reaching an altitude of 2,802 km over a flight time of 39 minutes.
North Korea has said it wants to develop a missile mounted with a nuclear warhead capable of striking the U.S. mainland.
To do that it would need an ICBM with a range of 8,000 km (4,800 miles) or more, a warhead small enough to be mounted on it and technology to ensure its stable re-entry into the atmosphere.
Some analysts said the flight details on Tuesday suggested the new missile had a range of more than 8,000 km, underscoring major advances in its program. Other analysts said they believed its range was not so far.
Officials from South Korea, Japan and the United States said the missile landed in the sea in Japan's Exclusive Economic Zone after being launched on a high trajectory from near an airfield northwest of the North's capital, Pyongyang.
"The test launch was conducted at the sharpest angle possible and did not have any negative effect on neighboring countries," North Korea's state media said in a statement.
The North said its missiles were now capable of striking anywhere in the world.
"It appears the test was successful. If launched on a standard angle, the missile could have a range of more than 8,000 km," said Kim Dong-yub, a military expert at Kyungnam University's Institute of Far Eastern Studies in Seoul.
"But we have to see more details of the new missile to determine if North Korea has acquired ICBM technology."
South Korean President Moon Jae-in, who convened a national security council meeting, said earlier the missile was believed to be an intermediate-range type, but the military was looking into the possibility it was an ICBM.
U.S. President Donald Trump wrote on Twitter: "North Korea has just launched another missile. Does this guy have anything better to do with his life?" in an apparent reference to North Korean leader Kim Jong Un.
"Hard to believe South Korea and Japan will put up with this much longer. Perhaps China will put a heavy move on North Korea and end this nonsense once and for all!," Trump said in a series of tweets.
Stock markets in both South Korea and Japan fell, with the Kospi ending down 0.6 percent and Japan's Nikkei share average ending down 0.1 percent.
Japan's Prime Minister Shinzo Abe said he would ask the presidents of China and Russia to play more constructive roles in efforts to stop Pyongyang's arms program.
"Leaders of the world will gather at the G20 meeting. I would like to strongly call for solidarity of the international community on the North Korean issue," Abe told reporters.
Japan said on Monday the United States, South Korea and Japan would have a trilateral summit on North Korea at the G20. Chinese President Xi Jinping will also be at the July 7-8 meeting in Hamburg, Germany.
Chinese Foreign Ministry spokesman Geng Shuang called for calm and restraint, and reiterated China's opposition to North Korea's violation of U.N. resolutions on missile tests.
Responding to Trump's tweet, Geng said China had for a long time been working hard to resolve the North Korean nuclear issue.
"China's contribution is obvious to all. China's role is indispensable," he told a daily news briefing.
China would continue to work hard and also hoped other parties would work hard too, Geng said.
"We hope all sides can meet each other half way."
North Korea says it needs to develop its weapons in the face of what it sees as U.S. aggression.
It has conducted five nuclear tests, two since the beginning of last year, and numerous missile tests over the past year.
It often times its tests to show its defiance and to raise the stakes when it sees regional powers getting ready for talks or sanctions, analysts say.
The launch took place hours before the Independence Day celebrations in the United States. North Korea has in the past fired missiles around this time.
LAST CHANCE FOR TALKS?
Despite the unprecedented pace of tests since the start of last year, analysts have said they believed North Korea was years away from having a nuclear-tipped ICBM capable of hitting the United States.
North Korea is also trying to develop intermediate-range missiles capable of hitting U.S. bases in the Pacific. The last North Korean launches before Tuesday were of land-to-sea cruise missiles on June 8.
David Wright, co-director of the Global Security Program at the U.S.-based Union of Concerned Scientists, said the assessments of the Tuesday flight time and distance suggested the missile might was launched on a "very highly lofted" trajectory of more than 2,800 km.
The same missile could reach a maximum range of roughly 6,700 km on a standard trajectory, Wright said in a blog post.
"That range would not be enough to reach the lower 48 states or the large islands of Hawaii, but would allow it to reach all of Alaska," he said.
South Korea's Moon said on Monday North Korea now faced its "last opportunity" to engage in talks with the outside world.
North Korea has conducted four ballistic missile tests since Moon took office in May, vowing to use dialog as well as pressure to bring Pyongyang's nuclear and missile programs under control.
This week, North Korea was a major topic in phone calls between Trump and the leaders of China and Japan, both of whom reaffirmed their commitment to a denuclearised Korean Peninsula.
Trump has recently suggested he was running out of patience with China's efforts to pressure North Korea.
(Additional reporting by Soyoung Kim in SEOUL, Kiyoshi Takenaka and Elaine Lies in TOKYO, Ben Blanchard in BEIJING and Ayesha Rascoe in WASHINGTON; Editing by Bill Tarrant, Robert Birsel)