|Wen said that relations between the two nations would "be doubtlessly firmer, closer and stronger" [EPA]
Wen Jiabao, Chinese prime minister has promised to stand by Pakistan and the international community in fighting extremism in the country.
He said, on Sunday, that Pakistan's efforts in the global fight against extremism should be recognised and respected by the international community.
The Chinese leader's comments have come just days after the United States said that Pakistan needs to step up its efforts in fighting armed groups, especially along the Afghan border.
Wen was addressing a joint session of Pakistan's National Assembly and Senate, on the final day of a three-day state visit that mainly focused on trade and business ties between the longtime Asian allies.
His comments appear to be part of China's strategy to lend support to old friend Pakistan, often criticised by the United States and many in the West as an unreliable, but necessary, ally in the war on terrorism.
The threat posed by religious fighters in Pakistan is a growing concern for China given that the two share a common border. And in addition to this, China is also dealing with its own Muslim separatist movement.
"Strengthening and promoting strategic, brotherly relations is our joint strategic choice and they are in the interests of two countries and their people," Wen said.
The speech to Pakistan's parliament was the first by a Chinese leader.
"Pakistan was at the front of the international fight against terrorism and made big sacrifices and important contributions, which were obvious to all," Wen told lawmakers.
"The international community should affirm that and give great support as well as respect the path of development chosen by Pakistan," he added.
He said the fight against terrorism should not focus on specific religions or ethnic groups, but rather on eradicating the "root factors breeding terrorism."
Robert Gates, US defence secretary, said on Thursday that it [Pakistan] needed to do more to control the flow of extremists, which a US review of the Afghan war, said was the main obstacle to ending the conflict.
Pakistan's porous border with Afghanistan is seen as a haven for armed fighters.
"Rock solid" relations
Al Jazeera's Pakistan correspondent, Kamal Hyder reported from Islamabad that, "The leader has said that the relationship between the two countries has withstood the test of time."
China is Pakistan's closest friend in Asia, giving Islamabad military aid and technical assistance, including nuclear technology.
And most Pakistanis view China as an ally that, unlike US, does not make demands in return for its assistance.
But Beijing is hardly left empty-handed from its ties with Pakistan, which serves as China's gateway to the Muslim world and is a cheap source of natural resources to fuel its growing economy, as well as a balance against India's military rise.
In addition, China has agreed to a $229mn donation to help Pakistan rebuild after this year's devastating floods.
Pakistan is desperately in need of foreign investment to help create jobs for its 175 mn people.
While boosting trade and investment has been the main focus of Wen's visit, the first in five years by a Chinese premier, analysts say that the trip is about more than just money.
Hamayoun Khan, an independent analyst said that, "It's a clear signal of China's growing, assertive diplomacy."
"They [China] do not want Pakistan to be entirely dependent on the United States and the International Monetary Fund, and then get dictation from them," Khan said.
"China's massive investment in this time proves two things. One is that China is a genuine ally of Pakistan, and second, it is a clear signal to the US that if the US supports India against China, China will support Pakistan."
During the visit, which followed a three-day trip to India, the two sides agreed to 35 new pacts expected to bring up to $30bn of investment to Pakistan over the next five years.
By comparison, Wen signed $16bn in deals in India before arriving in Islamabad on Friday.
Sino-Indian relations have been dogged by long-standing border disputes, which led to a war nearly four decades ago.
Source: Al Jazeera and agencies