Just as the United States sought to stabilize Pakistan during the war in Afghanistan, so China wants to prevent the spread of militant groups in Pakistan into Xinjiang, the far western region of China with a large Muslim population.
Washington tried to encourage the Pakistani government to try to stop terrorist groups from crossing the border into Afghanistan and attacking American troops, in part, by sending assistance intended to revive the gasping economy. Now, as China faces growing restiveness in Xinjiang, which has borders with Pakistan and Afghanistan, Beijing is attempting to help stem the flow of radicalism into its own backyard by bolstering development in perhaps the most vulnerable part of Pakistan.
Read MoreChina says no to Taiwan on AIIB: What it means
To the increasing frustration of China, a Muslim separatist group, the East Turkestan Islamic Movement, founded by Uighurs, a Turkic-speaking ethnic minority concentrated in northwestern China, operates alongside several Pakistani terrorist groups inside Pakistan's ungoverned tribal areas. A military operation was launched by the Pakistani Army in North Waziristan last June against the Taliban, also aimed at the Turkestan group, an action designed to please China.
A significant amount of China's new assistance, including a port facility at Gwadar on the Arabian Sea, and rails and roads leading from the port across Baluchistan Province and into western China, will be in areas close to the tribal areas where the militant groups operate.
The route from Gwadar to Kashgar, in Xinjiang — a project officially called the Economic Corridor — also serves as a shortcut for the shipment of goods from Europe to China, avoiding the Strait of Malacca farther east.
"The Chinese are stepping in, in a much, much bigger way than the United States ever contemplated," said Jahangir Tareen, a Pakistani businessman, and the secretary general of the Pakistan Tehreek-e-Insaf party. "The assistance is far, far more than the United States government offered under the United States Agency for International Development."
In advance of his trip, Mr. Xi wrote in a column distributed to the Pakistani news media over the weekend: "We need to form a '1+4' cooperation structure with the Economic Corridor at the center and the Gwadar Port, energy, infrastructure and industrial cooperation being the four key areas to drive development across Pakistan and deliver tangible benefits to its people."
Most striking about the visit is the scale of Mr. Xi's aid announcement compared with the American effort from 2009 to 2012 spearheaded in Congress by John Kerry, then a senator, and pressed in Pakistan by Hillary Rodham Clinton, then secretary of state. The program designated $7.5 billion for development projects over five years.
That effort was a "dramatic failure" because the resources were scattered too thinly, and had no practical or strategic impact, said David S. Sedney, a former senior official at the Pentagon responsible for Pakistan during that period.
More from The New York Times:
A new Whitney
Workers seeking productivity in a pill are abusing A.D.H.D drugs
Favorite streets in 12 European cities
The Chinese appear to have learned from the American program, including the notion that the American plan was designed to deliver a strategic result — deterring terrorism — but failed to do so, Mr. Sedney said.
To do better than the United States, the Chinese have come up with "a much larger financial commitment — and it is focused on a specific area, it has a signature infrastructure focus and it is a decades-long commitment," he said.
The Chinese Foreign Ministry said on Friday that the projects in Pakistan would be the first initiatives of the $40 billion Silk Road Economic Belt and Maritime Silk Road plans, an ambitious network of roads, rails and ports designed to link China to Europe through Central Asia and Russia, and announced with considerable fanfare by Mr. Xi in November.
China's assistant foreign minister, Liu Jianchao, declined to say how much of the Silk Road funds would go to the Pakistani projects, or how much the new Asian Infrastructure Investment Bank would lend. "It needs huge financing. China stands ready to provide financing," Mr. Liu said.
Mr. Xi embarks on his visit to Pakistan after the Finance Ministry announced last week that 57 countries had signed to join the new development bank.
Perhaps just as important as China's economic assistance is a major military deal that is unlikely to be publicized during the Chinese leader's visit, Pakistani analysts said.
Pakistan has agreed to buy eight Chinese submarines to counter India's naval dominance in the Indian Ocean, a $6 billion purchase approved by a parliamentary committee in Islamabad this month. The new submarines were "very quiet, capable and lethal," and a step up from previous Chinese arms sales to Pakistan, said Lyle J. Goldstein, associate professor at the Naval War College in Newport, R.I.