German police are investigating whether the fatal shooting of two US airmen at Frankfurt airport was a terrorist attack.

Another two American servicemen were wounded when a lone gunman opened fire on a US military bus parked outside the terminal building on Wednesday.

Investigators are pursuing what German media described as "substantial evidence" that the 21-year-old Kosovan suspected of carrying out the attack had links with Islamist groups in Germany. There is concern that more attacks may be in the works, said Spiegel Online.

FBI investigators were at the scene within hours of the attack and an investigation by the German authorities is under way.

The suspect, who is believed to have worked at the airport and grown up in Germany, has been identified by the Kosovan government as Arif Uka, originally from the northern town of Mitrovica.

Police are investigating reports he shouted "Allahu Akbar" (God is greatest) before pulling the trigger and are examining his Facebook account, which details what appear to be Islamist beliefs.

His Facebook wall links to a jihadist fighting song and a comment made on a friend's posting refers to "these miserable kuffar [infidels]". The last entry is dated Monday evening.

An American military official told the New York Times the US was not ruling out terrorism, although it was unclear whether the suspect was acting alone or with partners. "I don't know if he's tied to a group," the official said. "But there is enough information at this point to indicate that he identifies with Islamist terrorist ideology."

In Washington, Barack Obama said he was saddened and outraged by the attack. "We will spare no effort in learning how this outrageous act took place and in working with German authorities to ensure that all of the perpetrators are brought to justice," the president said.

A German investigator told Spiegel Online: "The mere fact that someone with a gun was in the vicinity of the airport is surely not a coincidence. It could be that we are dealing with a mentally disturbed lone perpetrator here, but he could also easily be a member of an organised group."

Police believe the attack was premeditated and the suspect must have known the bus would be there at that particular time. The vehicle allegedly had US air force number plates but the airmen, who were on their way to a big US base in Ramstein, were not wearing uniforms, reported the Frankfurter Allgemeine Zeitung.

American military typically wear civilian clothes when they travel overseas on commercial flights, and at civilian airports such as the one in Frankfurt, so they do not draw attention to themselves.

The dead and wounded servicemen have not been named, but the US air force has confirmed they were all UK-based military policemen en route to Ramstein to be deployed to Afghanistan.

An air force spokesman at Lakenheath airfield said all four were from the military base in eastern England. Lakenheath is home to the US's only F-15 fighter wing.

Germany has not had a terrorist attack like those in Madrid and London in the past decade, but three of the 9/11 attackers lived in Germany, and security officials acknowledge that it remains a breeding ground for Islamist radicals.

After a series of terror warnings last November, German police increased security at train stations, airports and prominent public places. The Reichstag building in Berlin has been cordoned off ever since and visitors have been banned from making impromptu trips to Norman Foster's glass "cupola" on the parliament building – previously one of the capital's top tourist attractions.

American troops have been based in Germany since the end of the second world war. The US has reduced its forces in Germany over the past decade, but it still has about 50,000 troops there.

It operates several major facilities in the Frankfurt region, including the Ramstein airbase, which is often used as a logistical hub for operations in Afghanistan and Iraq.

Frankfurt airport is a hub for American military personnel travelling to or from bases in Germany and has been a target in the past. A bomb exploded at a crowded departure lounge in 1985, killing a man and two children and wounding 42 people.