KABUL, Afghanistan — Afghan street children are packed into classrooms, raising their hands to answer math questions and bending their heads over art projects as part of a program funded by the European Union.

But the money is about to disappear after a four-year grant expires next month, and the Afghan government isn't ready to fill the gap. That leaves thousands of poor children who spend most of their days hawking goods on the street poised to lose their only access to an education.

The impending withdrawal of U.S. and other foreign combat forces means more than a loss of firepower. International aid is also on the decline because of donor fatigue and fears of deteriorating security after nearly 12 years of war.

The pullout of most international troops by the end of 2014 will leave many areas without the protection required for foreign aid workers. Even those workers who have more freedom of movement are concerned violence will increase as Afghan troops take over and the Taliban push to regain control.

Worried about losing hard-won gains, many Afghan and international aid organizations are racing to finish projects or find new sources of funding to provide basic services such as health care, education and electricity that the weak central government has been unable to deliver.

"The situation in Afghanistan is day by day becoming critical, but the international community is less interested," said Mohammad Yousef, founder of the children's program Aschiana.

Afghanistan has received $60 billion in international civilian assistance since 2002.