Long before the words "Silk Road" became synonymous with buying illicit drugs on the dark web, it was the name given to a network of lucrative trade routes that connected China to the Middle East and beyond. Now, with a mammoth $46 billion investment, China plans to build a modern version of the Silk Road through Pakistan and beyond.

With the creation of the China-Pakistan Economic Corridor (CPEC), a network of highways, rail roads and infrastructure projects spanning 1,800 miles from the Pakistani coastal port of Gwadar to China's far-western Xinjiang region, Beijing aims to transform global trade routes and increase its influence in South and Central Asia.

The investment is an extraordinary sum for Pakistan, where foreign direct investment totaled just $1.46 billion in the 2013 fiscal year. It also far exceeds the $31 billion of aid given by the US since the 9/11 attacks. Pakistan has been a tenuous ally in America's war on terror since 2001 but the US continues to be viewed negatively by most Pakistanis, potentially making a cash-lubricated strengthening of ties with China an attractive option.

"China just seems to be a good friend, whereas America seems to be a fair-weather friend," Ayesha Jalal, director of Tufts University's Center for South Asian and Indian Ocean Studies, told VICE News. "Pakistan has been economically on the margins for a long time. Pakistanis view the Chinese investment with great happiness."

Pakistan's Prime Minister Nawaz Sharif echoed that sentiment in a speech Monday during a visit from China's President Xi Jingping, calling friendship with the Asian giant "the cornerstone of Pakistan's foreign policy."

Unlike the American money, which has primarily gone to Pakistan's military, the Chinese investment is destined for projects that could benefit millions of Pakistani citizens. Energy projects aimed at doubling access to electricity in a country where blackouts are common account for $34 billion of China's total investment. Most of the rest will be spent on road, rail and transit projects.

Jalal cautioned the project was contingent on stabilizing volatile regions in both China and Pakistan. Gwadar lies in Pakistan's Balochistan province, the site of regular attacks from a long-simmering separatist insurgency. At the north end of the proposed corridor, on the border of Pakistan's tribal areas, is Xianjiang, a far-western province where China has been dealing with its own separatist movement by the indigenous ethnic Uighur population.

Before any work on the CPEC can happen, Jalal stressed, Pakistan must provide an environment safe for Chinese workers to build the roads, railroads, and power plants they've promised. "What happens in the long run will be contingent on Pakistanis figuring out internal security," said Jalal. "There are those who would see it from the point of view that the economic incentive is there, and would require a political solution."

China, which has a history of investing in unstable or authoritarian countries, appears unperturbed by the potential for insecurity to undermine their project. Jalal said many in Pakistan were hopeful the influx of money would finally get its government to address the longstanding tensions in Balochistan and other places where Chinese money lands.

Douglas Paal, vice president of the Carnegie Endowment for Peace's Asia Program, told VICE News the calculus for China had as much to do with domestic pressures as projecting influence in Asia. For years, partly in an attempt to keep its own currency from rising in value, China has invested its bountiful foreign reserves abroad, generally by buying government bonds in stable economies like the US.

But returns on those bonds are low. Now, after downgrading their growth targets for 2015 to a still-high 7 percent, Beijing is concerned about excess industrial and labor capacity at home. Investing in places like Pakistan helps address both of those concerns.

"They are always under pressure to improve that return," said Paal. "To get higher returns to have to take higher risks."

"Most of the money is going to go to Chinese workers that will be in Pakistan," said Paal, referring to infrastructure projects that, as is the norm for China, will be largely staffed by its own workers. Still, Pall said that even if jobs didn't go to Pakistanis, the electricity would.

"Most people see this as an opportunity to get improvements in their very basic public services," Paal explained. "They are very short of energy - they need roads, they need commerce."

The Gwardar-Xianjiang route will also provide China with important access to the Indian Ocean and the Middle East's vast trade in petroleum. It will combine with a previously-announced $40 billion "21st Century Maritime Silk Road", aimed at connecting the South China Sea, the South Pacific and Indian Oceans, as part of an overall plan to transform global trade routes dubbed "One Belt, One Road" by Chinese officials.

Orville Schell, director of Asia Society's Center on US-China Relations, says this expanded reach was a cause for concern for Washington. "There's been a slowly pixelating picture of expanding Chinese efforts around the world to influence countries and people," Schell told VICE News. "It's quite a well-pixelated picture at this point."

Xi's trip to Pakistan comes as Chinese officials ride a wave of endorsements from Western countries for its Asian Infrastructure Investment Bank, a $50 billion fund launched by Beijing. Despite protests from the US, traditional American allies like the United Kingdom, France, Italy and Germany have all joined the bank, which is partly modeled on the Washington-based World Bank.

For many years, China clamored to have its voting share at both the International Monetary Fund (IMF) and World Bank increased. Despite having the world's second largest economy, China only holds 5 percent of the votes at the World Bank, and 4 percent at the IMF. The US, meanwhile, holds 17 percent at each.

Efforts by the Obama administration to have China's quota raised, marginally, have been spurned by Congress. China's alienation from the global lenders and subsequent decision to strike out on its own have led to the perception that Washington's waning influence is partially self-inflicted.

Schell said there's a sense that China plays by rules that disadvantage the US — paying less heed to human rights records, environmental destruction and corruption in countries where it invests.

"The US does have certain standards for governmental transparency and democratic governance that they often apply — not always, but often," he said. "China seems to have abundant resources, and prefers countries that aren't democratic, because they are easier to manipulate."