For most of Kim Jong Il's reign in North Korea, relations between China and his isolated country have alternated between extreme suspicion and a grudging politeness based on mutual need.
The most intensive diplomacy between North Korea and China has taken place since Mr. Kim began to use his nuclear card two years ago. Now, as Kim agrees to rejoin the six-party talks in Beijing this month to discuss eliminating his nuclear-weapons program, many experts say that relations between the two states are ever more important.
China, in fact, has profited greatly from its role in the talks: It has drawn closer to both North and South Korea as a result of negotiations, while Washington has not.
Washington has counted heavily on China to persuade Kim to stop making a bomb - but in an international atmosphere in which the US is perceived to be bogged down in Iraq, China appears to have shifted its policy from "the nuclear problem in Korea, to the stabilization of North Korea," as Shin Sang Jin of Kwangwoon University in South Korea puts it.
Troubles between the two are longstanding, even if not well known. When the young Kim was brought to Beijing by his father, Kim Il Sung, in 1983, amid signals the son would take over the North one day - China didn't want a meeting. The 30 minutes finally accepted by Deng Xiaoping was secret. In serious communist states, dynastic rule is taboo - a point that China often made to the elder Kim. Nor was Deng impressed with the young Kim, say senior Chinese diplomats.
Fearing what his father often warned him of - creeping control of North Korea by China - Kim Jong Il has regularly purged military officers seen as too sympathetic to China. Beijing, for its part, practically shut off relations with North Korea after Kim took power in 1994. For the next seven years, only two low-ranking diplomats were sent to Pyongyang - and China accepted no important visitors from the North between 1991 and 1999, an extraordinary span, despite reports that Kim was seeking a meeting.
In recent months, US chief Asia diplomat Christopher Hill has reportedly pushed China to cut off its flow of oil to North Korea if Kim doesn't drop his program.
Such a step would involve a major commitment of political will, and a new strategic approach that seems out of keeping with the tone adopted by the Hu Jintao government. However, participation by the North in the upcoming talks could well forestall efforts to bring the North Korean case to the UN Security Council, something China has in the past passionately opposed.
"China can make or break North Korea," says Alexandre Mansourov of the Asia-Pacific Center, "But it is not in Beijing's interest to break. What China wants is a stable buffer between itself and US troops in the South."
Well-placed foreign sources in Beijing report that while it is unclear who has been paying Kim to participate in the nuclear talks, one of the six-party members "certainly" has been. It is generally regarded that only China and South Korea would offer Kim cash to participate.
Currently, relations between China and the North seem characterized by pragmatism, experts say, and this may be a relative improvement. Various phases of chill or warmth are often diplomatic or political window dressing. However, it seems clear that the old days when the two were as close as "lips and teeth," the era after the Korean War and into the 1960s - are long gone. Old ties of loyalty, ideological comradeship, and leadership relations - all have dissipated during the Kim Jong Il era. Kim has been unable to get an official invitation to visit China, though he did visit unofficially in 2000 and 2001.
Yet relations appear to have been sensitive dating back decades. In the 1960s, Kim Il Sung sought help from Mao in making a nuclear device, according to Don Oberdorfer's book "Two Koreas." Mao did not want such a project on his border.
The senior Kim often played Moscow off Beijing. During the Cultural Revolution, Mao sanctioned a campaign to criticize Kim Il Sung for this policy. Posters began to appear around Beijing describing the senior Kim as a barnyard animal "who sits on two chairs."
According to Krzysztof Darewicz, a Polish journalist who lived in Pyongyang during the transition to the younger Kim, the father calculated that his son's succession would cut down on factional infighting. The senior Kim was also deeply distrustful of China, and felt that without a strong family figure at the helm, it would be relatively easy for Beijing to "in time, exert its own will and influence in Pyongyang," he says.
Hu Jintao, then a Standing Committee member, visited Kim Il Sung in Pyongyang in 1993, but only two minor visits took place after that - until President Jiang Zemin visited in 2001, nearly a decade after he took power.
China has urged economic reforms for North Korea; that was the main message from Beijing under Jiang. It is thought that the Bush agreement with China to cooperate on the North was made with Mr. Jiang when he visited Bush's ranch two years ago, not long before he left power. President Hu will visit the US in September.