BEIJING (AFP) – Pakistan's prime minister declared China his country's best friend in an apparent dig at Washington as he was to begin a visit to China on Tuesday with US ties tested over Osama bin Laden's killing.

Yousuf Raza Gilani's trip follows the killing of the Al-Qaeda leader by US special forces on Pakistani soil this month in a raid that has cast a pall over US-Pakistan ties and was seen potentially pushing Islamabad closer to Beijing.

"We appreciate that in all difficult circumstances, China stood with Pakistan. Therefore we call China a true friend and a time-tested and all-weather friend," Gilani told China's official Xinhua news agency in an interview.

"We are proud to have China as our best and most trusted friend, and China will always find Pakistan standing beside it at all times," added Gilani, who was to arrive in Shanghai later Tuesday, according to Pakistani officials.

His comments appeared to underscore tensions with Washington following the May 2 US raid on a compound where bin Laden was living in northern Pakistan, which left the country's civilian and military leaders angry and embarrassed.

On Monday, US Senator John Kerry demanded Pakistan make progress against terrorism through "actions, not by words" in a visit to the country.

The fact that the terrorist mastermind had been hiding out in Pakistan, possibly for years, has raised accusations the country's powerful security establishment was either incompetent or complicit in bin Laden finding a haven.

Gilani had no engagements in China until a speech Wednesday at a cultural forum in the eastern city of Suzhou, Pakistani officials said.

He was then to travel to Beijing to meet Chinese leaders including President Hu Jintao and Premier Wen Jiabao.

The two sides are expected to sign a series of cooperation agreements and discuss how they can better combat extremism.

China is the main arms supplier to Pakistan, which sees Beijing as an important counter-balance to Pakistan's traditional rival India. New Delhi has recently improved its ties with the United States, causing worry in Islamabad.

China and Pakistan were expected to reaffirm their "all-weather" friendship during Gilani's stay.

Foreign ministry spokeswoman Jiang Yu said Tuesday that Beijing "unswervingly" supports Pakistan's counter-terrorism efforts.

"Pakistan has made very important contributions in international counter-terrorism cooperation as well as great sacrifices," she told reporters.

By contrast, Kerry stressed that US lawmakers were demanding a review of billions of dollars in aid money to Pakistan.

"Ultimately, the Pakistani people will decide what kind of country Pakistan becomes, whether it is a haven for extremists or the tolerant democracy" it was founded as, said Kerry, chairman of the US Senate Foreign Relations Committee.

Facing weak Western investment in its moribund economy and crippling power shortages, Pakistan is looking for closer trade and energy ties with China.

Pakistan last week opened a 330-megawatt nuclear power plant in central Punjab province with Chinese help and said Beijing had been contracted to construct two more reactors.

The plans have triggered US concern over the safety of nuclear materials in the unstable, violence-plagued country where Muslim militancy is strong.

However, political analysts have said a wary Beijing was unlikely to buttress its verbal backing of Islamabad with significant aid money or other new support out of fear of getting too entangled in the troubled nation's fortunes.