Updated

The suspect in the murder of two U.S. airmen at the Frankfurt airport confessed that he specifically wanted to kill Americans as revenge for the Afghan war, a German investigator said Friday.

Prosecutor Rainer Griesbaum told reporters that 21-year-old Arid Uka from Kosovo said he went to the airport with the intent to shoot “as revenge for the American mission in Afghanistan.”

Griesbaum also said that Uka’s pistol malfunctioned during the attack, preventing further loss of life. After shooting and injuring two more airmen he pointed the pistol at the head of a third and pulled the trigger twice, but the weapon jammed.

U.S. officials tell Fox News that German authorities are investigating "substantial evidence that Uka has links to Islamic fundamentalist groups in Germany." Officials also say evidence supports the view so far that Uka did act alone -- which he stated -- but no final conclusions have been reached.

Hesse Interior Minister Boris Rhein told reporters Thursday in Wiesbaden that Uka was apparently radicalized over the last few weeks by looking at Islamist websites in Germany. U.S. officials confirm that the suspect was extremely active on the Internet, specifically Facebook. They say they are looking for any potential contacts with the American cleric Anwar al-Awlaki, who is seen as the new generation of digital jihadist.

The U.S. Air Force released the names of the victims on Thursday: Senior Airman Nicholas J. Alden , 25, of Williamston, S.C., and Airman First Class Zachary R. Cuddeback, 21, of Stanardsville, Va.

A U.S. law enforcement official says the suspect was not on any American terrorism watch list.

Rhein says that the investigation indicates that he acted alone and did not belong to a terrorist network or terrorist cell, but German federal prosecutors say the attack appears to have been motivated by Islamic extremism.

Uka told investigators a YouTube video he saw the day before the incident allegedly showing a raid on a home by U.S. soldiers in Afghanistan had inspired him to prevent "further cruelties."

When he saw the bus clearly marked as U.S. Airforce parked outside Terminal 2, he approached an airman outside and, under the pretext of asking for a cigarette, asked if the servicemen were on their way to Afghanistan.

"When he said yes, he shot the 25-year-old serviceman from behind in the head," Griesbaum said.

Uka then stormed onto the bus carrying 15 other airmen, yelling "Allah Akbar!" -- Arabic for "God is great!" -- and shot the driver in the head, killing him as well, Griesbaum said.

He then shot a 25-year-old airman who was sitting on the bus twice, and then turned his gun on another airman, 21 and fired once, injuring both of them, Griesbaum said.

"Then he tried to shoot a 22-year-old," Griesbaum said. "He pointed his pistol at his head and pulled the trigger twice, but the pistol jammed and no shots came out."

Even though there were still six shots in the magazine, the jam prevented any further firing and Uka fled the bus.

All of the airmen were based at the Lakenheath military base in Britain.

They were all based at the Lakenheath military base in Britain.

President Obama said he was "saddened and outraged" by the shooting.

The president says the U.S. will spare no effort in finding out how the "outrageous" act took place and will ensure the perpetrators are brought to justice. He called it a tragedy.

In Berlin, German Chancellor Angela Merkel said her sympathies were with the victims and their families, and pledged that Germany would do everything in its power to investigate the crime.

"It is a terrible event," she said.

The U.S. has drastically reduced its forces in Germany over the last decade, but still has some 50,000 troops stationed here. It operates several major facilities in the Frankfurt region, including the Ramstein Air Base often used as a logistical hub for operations in Afghanistan or Iraq.

At the airport, taxi cab driver Salimi Seraidon said he was sitting at a stand about 200 yards away when the attack took place and said it was over quickly as police rushed onto the scene.

"We just heard the shots," he said.

The American forces in Germany have been targeted in attacks in the past, including a 1986 bombing at a disco in then-West Berlin that was known to be frequented by U.S. servicemen.

Two soldiers and one civilian were killed, and 230 others injured in that attack, which a Berlin court in 2001 ruled was organized by the Libyan secret service and aided by the Libyan Embassy in then-communist East Berlin.

The leftist terrorist Red Army Faction was also responsible for a string of attacks on Americans in the 1970s and 1980s before the group was disbanded in 1998.

More recently, German police thwarted a plot in 2007 to attack U.S. facilities by members of the extremist Islamic Jihad Union. Four men had planning to attack American soldiers and citizens at facilities including the U.S. Air Force's Ramstein Air Base in Germany but were caught before they could carry out the plot.

The Associated Press contributed to this report.