Regional security analysts say a six-day visit by Pakistani President Asif Ali Zardari to China this week - his fifth since stepping into office - highlights the growing ties between the two countries. They say that in addition to providing a hedge against India in the region, Pakistan is Beijing's window on Afghanistan and its strategic interests in the war torn country.
For Pakistan, President Zardari's trip to China seems to be largely focused on drawing Chinese investment to the country.
On Wednesday in Beijing, Mr. Zardari met with Chinese business leaders from industries ranging from banking to defense. The president appealed for Chinese help in developing the country's energy sector and noted that the true potential of business opportunities between the two countries had yet to be realized.
Mr. Zardari and Chinese President Hu Jintao signed six agreements, but details were not made public.
Sumit Ganguly, a political science professor at Indiana University, says that while Islamabad is looking to Beijing to help build up its infrastructure and address its energy needs, China is looking to Pakistan to understand the future of Afghanistan.
"The Pakistanis recently have been talking to the Taliban and have been trying to convince President Karzai to reach an agreement with the Taliban as the U.S. prepares to withdraw in July 2011," he said.
Gangulay says that Pakistan would like to have a government that incorporates the Taliban in Afghanistan because Islamabad believes such a regime would be sympathetic to Pakistani interests.
"Karzai is under considerable pressure from the Pakistan to fold, and the Chinese are curious probably to know how exactly things will play out," he said.
Michael Swaine, a senior associate at the Carnegie Endowment for International Peace in Washington, says China looks at the Afghanistan situation through its relationship with Pakistan.
"If there is a problem in Afghanistan and Pakistan is concerned about that problem, China wants to make sure it is on the same wave length as Pakistan," he said.
Swaine says that such problems could be anything that raise questions and concerns about the stability of Afghanistan - such as the expansion of Indian influence or the emergence of Taliban groups that do not support the Pakistan government.
Dan Blumenthal of the American Enterprise Institute in Washington says both Pakistan and China are using their relationship as a hedge against the possibility that the U.S. does not succeed in Afghanistan.
"That key relationship has always been important for both sides, for the Chinese increasingly so; to have some influence in South Asia and Central Asia, and for the Pakistanis to have options in case things go really south in Afghanistan," he said.
Professor Gangulay says that Beijing's close relationship with Islamabad has helped China in Afghanistan and made it possible for the Chinese to avoid working with the U.S. government in any meaningful fashion.
"The Chinese are doing quite well in Afghanistan," he said. "They have managed to get lucrative contracts to extract copper and other mineral resources from Afghanistan. And as long as the Pakistanis have a substantial presence after the American withdrawal, why should they care about our [U.S.] interests."
President Barack Obama has set July 2011 as a date to begin withdrawing U.S. troops from Afghanistan, if conditions on the ground permit.
However, analysts like Michael Swaine note that China is not looking for the United States to quickly pull out of Afghanistan, because that could result in more instability that would threaten the region and its economic interests there as well.
"Now that said, I don't think they [China] want the United States to remain in Afghanistan either for an extended period of time," said Swaine. "They want a stable regime in Afghanistan that they can work; that will be accepting of and receptive of both their economic interests in Afghanistan - which are growing and are significant - and a regime that will work with Pakistan."
China has large investments in Afghanistan, including a multi-billion dollar project to develop a copper mine in the Aynak valley, just south of the capital, Kabul. It has also provided a range of aid to Afghanistan by helping it build a communications infrastructure, hospitals, and irrigation systems among other projects.
Despite concerns voiced by its critics, Chinese officials say Beijing's relationship with Islamabad benefits peace, stability and prosperity of the region.