Pakistani leaders often wax lyrical about their "sweeter than honey" relations with all-weather friend China. There's no romance about their marriage of convenience with America.
As the Trump administration plots its policy toward a key partner, it will find Pakistan being drawn deeper into Beijing's embrace and its promise of $46 billion in energy, infrastructure and industry investments by 2030. The money could transform the Muslim nation's economy.
Washington, by contrast, is losing faith in how much its largesse can influence Pakistan. Many frustrated US policymakers see Pakistan as a terrorist haven that some $30 billion in security and economic assistance since the 9/11 attacks has failed to fix. But an American retreat could have broad implications for its ability to maintain stability in a regional powder keg of extremism, weak governance and various potential conflicts.
"I get the sense that we are the dispensable ally once again," Bilalwal Bhutto said during a recent visit to Washington.
US assistance to Pakistan has been declining since 2011 when American commandos killed Osama bin Laden inside Pakistan, straining relations. And as the US troop presence in neighboring Afghanistan has shrunk, Pakistan has become a lower priority. Aid could decline further as President Donald Trump proposes drastic cuts to diplomacy and foreign aid budgets.
Still, Trump's vow to protect America from violent extremism may make it difficult for him to turn his back on Pakistan, a nuclear-armed nation where al-Qaida leader Ayman al-Zawahiri is suspected to be hiding and which could hold the key to an Afghan peace settlement. The 8,500 US troops still deployed in Afghanistan means the US retains a high interest in seeing Pakistan rein in cross-border attacks by Taliban militants, whatever Washington's larger regional objectives may be.
China is also concerned about militancy in Pakistan, particularly by ethnic Uighur groups that have reportedly sought refuge in the Pakistan-Afghanistan border region and forged links with al-Qaida and the Taliban. But above all, China sees strategic and economic opportunities in Pakistan.
The unlikely alliance is a critical part of China's ambitious "One Belt, One Road" project to link markets in Asia and Europe. Pakistan's offer of access to the Indian Ocean could reduce China's reliance on the chokepoint of the Malacca Strait in Southeast Asia for oil imports from the Mideast, and help spur development in China's land-locked far west.
Ahsan Iqbal, Pakistan's planning and development minister, called the investment a "blessing." The nation of 200 million people is blighted by power shortages and other failings, and has struggled to attract foreign firms because of persistent extremist violence.
Chinese private investors are planning $35 billion in energy generation and transmission projects, he said. Some 10,000 megawatts of power is slated to come online by 2018. That can hugely boost the country's generation capacity of just 22,000 megawatts, or a little more than the capacity of Switzerland, which has 1/25th of Pakistan's population.
Chinese loans also will fund more than $10 billion in roads, rail and facilities at a deep sea port.
"The story of Pakistan is changing," Iqbal told a Washington think tank last month. He asked, rhetorically, of the United States: "We are ready. Are you ready?"
Government spin aside, volatile, coup-prone Pakistan has enjoyed several years of relative political stability, allowing the economy to claw back from crisis. The Karachi stock market rose by 46 percent in 2016. GDP is set to grow by about 5 percent this year, helped by low oil prices.
Violence remains pervasive, however. The military has pressed offensives against the Pakistani Taliban, but a recent spate of suicide bombings killed 125 people. The Islamic State group claimed responsibility.
While Trump hasn't outlined any Pakistan approach, Congress is laying down markers.
Last year, lawmakers blocked US funding for sales of F-16 fighter jets to Pakistan and for this year are withholding $400 million in coalition support funds until the US defense secretary certifies that Pakistan has taken action on a Taliban faction long favored by the nation's military and intelligence services.
Pakistan's archrival, India, is an increasingly close US partner. It similarly accuses Pakistan of selectively fighting terror and is trying to isolate Islamabad diplomatically. Such maneuverings are having the effect of pushing Pakistan closer to China, which once fought its own border war with India.
"If everything goes to plan then Pakistan could enjoy a bonanza of benefits from easing its energy crisis to providing badly needed infrastructure," said Michael Kugelman, a South Asia expert at the Wilson Center in Washington. But he cautioned that Pakistan may overestimate how much China, which prioritises its own interests, will ultimately commit.
To provide reassurance, Pakistan's government is guaranteeing payments to Chinese producers in case local electricity distribution companies fail to compensate them once power plants go online. To address security concerns, Pakistan is reportedly deploying 15,000 forces to protect workers on Chinese projects.
Critics say the Chinese deals are opaque, leaving uncertainty about how impoverished local communities will benefit. And India fears that an increasingly assertive Beijing wants to use Pakistan's deep sea port at Gwadar as a base for China's navy in the Indian Ocean.
Pakistan's military ties with China are deepening. Their joint production of the JF-17 Thunder fighter jet suggests that China could eclipse the US as Pakistan's favored source of high-end defense equipment, said Jonah Blank, South Asia expert at the RAND Corp. China is already its main source of low-tech military gear.
On the economic front, US assistance has failed to leave a "footprint" like China's investment, said Ishrat Hussain, a former Pakistani central bank governor.
Hussain said the benefits of China's investment will take at least a couple of years to be felt but could end power outages that have crippled industry and establish road and rail links to spur the nation's neglected western flank. He urged America to focus on fostering science and technology in Pakistan.