Chinese President Hu Jintao ended a four-day visit to Pakistan on Sunday during which he promised to work with Islamabad to elevate strategic ties to "a new high" and strengthen trade and economic cooperation.
Hu had visited India immediately before coming to Pakistan, and the Chinese leader avoided taking sides over the South Asian rival's perennial dispute over the Kashmir region, and instead focused on economic partnerships with both countries.
A crowd of well-wishers waving Chinese and Pakistani flags where at the airport in the eastern city of Lahore, as Hu, seen off by Pakistani Prime Minister Shaukat Aziz, left for home at the end of the first visit by a Chinese president for a decade.
Pakistan has treasured its relationship with China, mainly because the East Asian giant offered it a counterweight in dealings with India, and continued to supply arms in the 1990s, when the United States shunned Pakistan because of its nuclear weapons program.
China has its own territorial disputes with India, and two nations are still trying to overcome decades of mistrust going back to a border war in 1962.
These days, China is keenly focused on forging economic ties with its neighbors, but analysts said Hu was keen to demonstrate that China's growing links with India would not come at Pakistan's expense.
During Hu's visit to Islamabad, China and Pakistan signed a free trade pact that could boost annual trade from $4.26 billion last year to $15 billion within five years. They also inked a five-year plan to enhance economic cooperation.
China also said it would continue to support Pakistan's nuclear energy program, though there was no commitment to build six new power plants that Pakistan wants.
While Hu was in New Delhi, China and India agreed to try and double bilateral trade to $40 billion by 2010.
Pakistan's Daily Times newspaper noted how adroitly China was managing its relations with Pakistan and India, and other newspapers also carried editorials trumpeting the benefit of enhanced economic ties with China.
China signed 18 agreements in Pakistan, including the free trade agreement and 13 deals with Chinese companies worth $3 billion.
"So no one in Islamabad should be miffed that China has excused itself from taking sides on the Kashmir issue," a Daily Times editorial said on Sunday.
"Pakistan used to call China its "all-weather friend" because it leaned clearly in favor of Pakistan since 1962, when China fought its war with India.
"Now Pakistan says China is still its "all-weather friend" after hearing from the Chinese they don't want to take sides on Kashmir."