Europe should be spending more on its military given the security challenges facing the region, U.S. Defense Secretary Ashton Carter said on Wednesday, adding that falling investment had eroded Europe's ability to be a capable U.S. ally.

"They're not doing enough. They are spending a smaller share of their GDP than they have in the past, [than] we do now and [than] many, like Russia, are spending. It's too low," Carter told a group of university students training as military officers.

The Pentagon chief made the remarks after being asked by one student what the United States could do to encourage Europe to be more financially committed to its own defense.

Low European military spending has long been a sore point for the United States. U.S. presidents and defense secretaries regularly urge the allies to stop the slide in spending.

The NATO air campaign that led to the ouster of Libyan dictator Moammar Gadhafi in 2011 exposed a number of weaknesses among alliance militaries, such as a lack of reconnaissance aircraft and of specialists needed to identify bombing targets.

At a summit last year in Wales, the 28 NATO partners renewed their commitment to the goal of each country spending 2 percent of GDP on defense.

But only four countries - Estonia, Greece, Britain and the United States - were meeting the target in the 2013-14 time frame, according to a NATO report in January. Turkey, France and Poland were just shy of the goal over the same period.

Carter said Russian aggression in Ukraine, the refugee problem in northern Africa and the mass killing at the Charlie Hebdo satirical magazine in Paris were wake-up calls about the need to boost security.

"I think when the Cold War ended a lot of Europe figured that its security problems had ended. And now they're beginning to wake up," he said.

"You have Turkey, a NATO ally, right there on the front lines with Syria and Iraq and the fight against ISIL," Carter added, using an acronym for Islamic State militants.

Carter acknowledged Europe had been slower to recover from the financial crisis than the United States, but he insisted Europe still had the means to reach the 2 percent commitment.

"It has to have the military power to be a capable ally of ours and we see that slipping," he said. "That's got to turn around."