In Kiev, hundreds of thousands of Ukrainians have taken to the streets to demand the government join the European Union, in the hopes it will spur economic growth. In Kabul, Afghan leaders overwhelmingly voted to have American troops remain for another decade, in the hopes they will maintain a “war and aid economy” that has brought them unprecedented riches.

As a fiscally constrained and war-weary Washington confronts its foreign policy challenges, events in Ukraine and Afghanistan show that economic incentives can play a major role in addressing them. Younger generations in both countries are eager for prosperity, reduced corruption and a place in a globalized economy. Globalism is challenging cronyism.

In Ukraine, many motives are driving the young demonstrators, who have been protesting since President Viktor Yanukovich abruptly announced that he would not sign an association agreement with the European Union. But a key belief voiced by protesters is that adopting EU-mandated judicial reforms would reduce the country’s staggering levels of corruption.

“They get access to the European rule of law,” Steven Pifer, a Brookings Institution senior fellow and former U.S. ambassador to Ukraine, said in a telephone interview Tuesday. “They don’t have worry about the corruption and the arbitrary seizure of property.”

Many Ukrainians, however, may overestimate the economic benefits of joining the European Union, as Julia Ioffe pointed out in the New Republic on Tuesday. Croatia’s economy, for example, has been tepid since it joined. And one of the first reforms the EU requires would mean increasing the low price of gas set by Ukraine’s notoriously corrupt energy sector.

Yanukovich’s surprise decision came just as Russian President Vladimir Putin is economically pressing Ukraine to join a rival trade group, led by Russia. This dispute is the latest example of jockeying between Putin and the West — which extends from the former Soviet bloc to the Middle East.

In recent years, U.S. officials have stepped back in Eastern Europe and allowed European Union officials to take the lead. While some have criticized that move as signaling weakness, Pifer argues that the European Union is more popular in Ukraine than the United States. Washington stepping back also eliminates a propaganda tool for the Russian leader.

“Putin can portray it as the United States is leading the charge,” Pifer said. “It’s another effort by the U.S. to hem in Russia.”

In Afghanistan, similar lessons are emerging. In a country famed for its xenophobia, the vast majority of the country’s political elite have criticized President Hamid Karzai’s last-minute refusal to sign a Bilateral Security Agreement, or BSA, that would allow a small number of U.S. forces to remain for a decade.

The reason? Economic. American and international funding of the Afghan government and its security services offers vast patronage opportunities for local leaders.

“Most political elites want the BSA signed as soon as possible,” Andrew Wilder, the director of Afghanistan and Pakistan programs at the United States Institute of Peace in Washington, told me by phone this week. “Precisely because they think the patronage opportunities will shrink if it is not signed.”

Wilder argued that there are also strategic reasons for a small number of U.S. troops to remain in Kabul. Without a significant international presence, he said, the country would likely revert to civil war and again become a haven for militants. The economic and social gains of the last 12 years need to be protected.

Meanwhile, a vast economic boom has occurred in Afghanistan’s cities. A “health revolution” has led to a historic increase in average life expectancy — from 42 years to 62 years in just over a decade, which Wilder described as “unprecedented in human history.” And a “media revolution” has exponentially increased access to information — mobile phones and Facebook are enormously popular.

Too much of this growth, however, is dependent on foreign military spending and aid. Ninety percent of the Afghan government budget — including $4 billion in security force spending — comes from foreign governments. “[The United States] created this war and aid economy bubble,” Wilder said. “The question is how do we let the air gradually out rather than pop the bubble, which would be destabilizing.”

A more connected and affluent generation of Afghans is emerging as well. Younger Afghans last year formed a promising new civil political movement, Afghanistan 1400, The name is a reference to the new century approaching in the Afghan calendar — where the current year is 1392.

Haseeb Hamayoon, a member of this group, said that exposure to the outside world has given younger Afghans new aspirations for their nation. The group’s motto is “Our Country, Our Responsibility” and it seeks to broaden the younger generation’s influence in politics and society — since an estimated 68 percent of Afghanistan’s population is under age 30.

Hamayoon said rural areas are now better connected to cities, because of thousands of miles of new roads. Cities are also more connected to the outside world, because of cell phones, satellite televisions and Web access.

“The kind of exposure that this country has seen in the last 12 years and the connectivity is absolutely something that has never been seen before,” he said. “Don’t underestimate the impact of Turkish soap operas on [everything from] family structure to even how tea is served.”

Whether Afghanistan 1400 will emerge as true political force remains to be seen.

Ukraine’s young protesters face a long struggle as well. But the Obama administration should take heed of the new dynamics emerging. In addition to providing military aid, Washington should promote private-sector investment, trade and entrepreneurship.

America’s ossified, military-focused foreign policy must learn to focus on economic forces — not just military power — to bring about lasting change.