Just 24 hours after President Donald Trump took aim at Pakistan on Twitter, the South Asian nation already appears to be cozying up to the world's second-largest economy.

A day after the U.S. leader slammed Islamabad for harboring terrorists in a New Year's Day tweet, Pakistan's central bank announced that it will be replacing the with the yuan for bilateral trade and investment with Beijing.

The same day, Chinese Foreign Ministry spokesman Geng Shuang defended Islamabad's counter-terrorism track record, saying the country "made great efforts and sacrifices for combating terrorism" and urged the international community to "fully recognize this."

China has been watching closely as U.S.-Pakistan relations become increasingly strained. Trump has long demanded the frontier economy to do more on counter-terrorism while he simultaneously grew closer to its arch-rival, India.

"Pakistan and the U.S. have had a fraught relationship for years, but the big change recently has been China," said Simon Baptist, Asia regional director at the Economist Intelligence Unit. "China has really gone hard in cementing its existing relationship with Pakistan, it's really the only place that's seen significant investment under the Belt and Road initiative and China has been pushing for geopolitical advantage there."

Islamabad is home to one of Beijing's central infrastructure schemes, a near $60 billion collection of land and sea projects known as the China-Pakistan Economic Corridor — a centerpiece of Belt and Road.