BEIJING North Korea's leader Kim Jong-il visited China this week, winning vows of economic support for his troubled country, despite tensions over his nuclear ambitions and the sinking of a South Korean ship.
Here is an overview of Chinese-North Korean ties.
Communist China was a crucial backer of North Korean Communist forces in the Korean War, sending soldiers across the border into Korea from October 1950. The two neighbors formally established relations in October 1949.
After the 1953 armistice, China continued supporting North Korea, helping with its post-war reconstruction.
In 1961, the two countries signed a Treaty of Friendship, Cooperation and Mutual Assistance, which calls for either to aid the other if attacked. It remains in force.
After China's rapprochement with the West and its founding of formal diplomatic ties with South Korea in 1992, ties between Beijing and Pyongyang turned frosty.
In recent years, China sought to shore up ties with North Korea and has increased aid to its poor neighbor.
Chinese Premier Wen Jiabao visited North Korea in October 2009, when he was given an effusive welcome by Kim Jong-il. Wen was the most senior Chinese visitor since President Hu Jintao went there in 2005.
Prior to this week's visit, Kim Jong-il last went to China in 2006. He also visited in 2000, 2001 and 2004.
South Korea lost 46 sailors when its warship, the Cheonan, sank on March 26 after what is believed to be a North Korean torpedo strike. If that possibility is confirmed, it would be one of the deadliest strikes by Pyongyang since the end of the Korean War.
China has stayed low-key about the issue, reflecting its desire to keep friendly ties with both North and South Korea. Chinese officials have voiced sympathy for the deaths but avoided any public pressure on Pyongyang over the incident.
NOT ALWAYS IN STEP
Chinese officials and analysts say Beijing's sway over Pyongyang is more limited than Western governments assume.
In October 2006, North Korea held its first nuclear test explosion, defying public pleas from China. Beijing condemned the test and supported U.N. Security Council Resolution 1718, which authorized sanctions against North Korea and demanded it halt nuclear weapons and ballistic missile activities.
After the North held its second nuclear test on May 25, 2009 Beijing backed Security Council Resolution 1874, authorizing more sanctions on Pyongyang, including a ban on its arms exports.
China has sought to defuse confrontation over North Korea by hosting six-party nuclear disarmament talks since August 2003.
The negotiations bring together North and South Korea, China, the United States, Japan and Russia, seeking to end the North's nuclear weapons ambitions in return for aid.
The six-party talks have been stalled for more than a year. In April 2009 North Korea said it was quitting them and reversing nuclear "disablement" steps it had agreed to, unhappy with implementation of an initial disarmament agreement reached at the talks in 2007.
China and other powers have been trying to coax Pyongyang back to the negotiations.
China's trade and aid have become crucial to North Korea's survival, especially as ties with South Korea have frayed.
In 2009, trade between China and North Korea was worth $2.7 billion, a fall of 4 percent compared with 2008 numbers, according to Chinese customs statistics. North Korea's exports to China rose by 4.3 percent to $793 million.
In 2009, China's bilateral trade with South Korea was worth $156.2 billion, according to Chinese statistics.
In the first three months of 2010, China's imports from North Korea -- which are mostly minerals, coal and seafood -- fell by 17.5 percent in value compared to the same time last year, despite China's frenetic economic growth. China's exports to North Korea grew by 17.2 percent.
Kim may be looking to increase the flow of oil and food. In 2009, China shipped 519,814 metric tonnes of crude oil to North Korea, a fall of 1.7 percent on 2008. China sent 50,589 tonnes of gasoline, up 17.2 percent compared to 2008.
China is not specific about how much of this trade is really aid, and it does not give separate statistics on aid.
China's 1,415-km (880-mile) border with North Korea includes stretches of rivers that freeze over in winter, and in past years many North Korean refugees have crossed over, sometimes then making their way to other countries.
Outside groups have earlier estimated their numbers to be from tens of thousands to 300,000 or more. More recently, stronger border controls and reduced famine in the North appear to have reduced arrivals.
(Sources: Reuters; Chinese Ministry of Commerce website www.mofcom.gov.cn; International Crisis Group; Andrew Scobell, "China and North Korea: From Comrades-in-Arms to Allies at Arm's Length"; U.S. Committee for Human Rights in North Korea; Congressional Research Service report, "China-North Korea Relations")
(Reporting by Chris Buckley, Editing by Ken Wills and Sanjeev Miglani)