North Korea has agreed to give up all nuclear activities and rejoin the nuclear non-proliferation treaty, in a move diplomats called a breakthrough.
North Korean delegates gave a standing ovation as the talks ended
In return, the US said it had no intention of attacking the North, which was also promised aid and electricity.
The agreement came during a fourth round of six-nation talks in Beijing, aimed at ending a three-year standoff over North Korea's nuclear ambitions.
But correspondents warned that some key issues had not yet been resolved.
"This is the most important result since the six-party talks started more than two years ago," said Wu Dawei, China's vice foreign minister.
DETAILS OF DEAL
N Korea to abandon all nuclear weapons and programmes
N Korea to return to nuclear treaty and UN monitoring
US states it has no intention of attacking N Korea
N Korea says it has right to "peaceful uses of nuclear energy"
N Korea's demand for light water reactor to be discussed at "appropriate time"
Mohammad ElBaradei, the head of the International Atomic Energy Agency [IAEA] also welcomed the development, saying that UN inspectors should return to North Korea as soon as possible.
"The earlier we go back the better," he said.
The chief US negotiator at the talks, Christopher Hill, praised the development as a "win-win situation", adding: "We have to seize the momentum of this."
But he promptly urged Pyongyang to end operations at its main nuclear facility at Yongbyon.
"The time to turn it off would be about now," Mr Hill said.
The BBC's Charles Scanlon in Seoul says that while the statement appears to be a significant step forward in principle, difficulties may arise in its implementation.
One issue which has yet to be resolved is North Korea's demand that it be given a civilian light-water nuclear reactor to generate electric power.
This US has described this request as a non-starter, but agreed in Monday's statement that the issue could be addressed again in the future.
Disagreement also remains over the scope and scale of North Korea's weapons programmes.
The question of verification of these programmes has yet to be addressed - an issue which our correspondent says could present the most formidable obstacle to a final agreement.
This historic joint statement came as hope was fading that the six-party talks could ever reach a deal.
Oct 2002: US says North Korea is enriching uranium in violation of agreements
Dec 2002: North Korea removes UN seals from Yongbyon nuclear reactor, expels inspectors
Feb 2003: IAEA refers North Korea to UN Security Council
Aug 2003: First round of six-nation talks begins in Beijing
Feb 2005: Pyongyang says it has built nuclear weapons for self-defence
Sep 2005: N Korea agrees to give up nuclear goals
Correspondents say the US was on the verge of walking out of the talks and heading home - a fact that may have been the clincher which forced North Korea to back down.
In Monday's statement, the North "promised to drop all nuclear weapons and current nuclear programmes, and to get back to the Non-Proliferation Treaty as soon as possible".
This latter detail is crucial, as it will allow United Nations inspectors to return to the North's nuclear sites.
In return the US made some conciliatory statements, affirming it had no nuclear weapons on the Korean peninsula and "has no intention to attack or invade [North Korea] with nuclear or conventional weapons".
The joint statement also said the other five nations involved in the talks - China, Japan, South Korea, Russia and the US - were willing to provide energy assistance to North Korea, as well as promoting "economic co-operation in the fields of energy, trade and investment".
South Korea has already offered to deliver 2m kilowatts of electric power.
The agreement also mentioned North Korea's relations with Japan.
Tokyo and Pyongyang have been locked in a dispute about Japanese citizens kidnapped by North Korea, and the statement promised the two countries would "take steps to normalise their relations".
The six parties agreed to implement Monday's agreement "in a phased manner", using the principle of "commitment for commitment, action for action".
When they meet again in November, they will have the difficult task of working out how this will work in practice.
The long-running nuclear dispute began in late 2002, when the US accused North Korea of having a uranium-based nuclear arms programme, in violation of international agreements.