Several people were killed on Friday in a shooting rampage by a lone gunman in a Munich shopping centre, police said.

The Bild newspaper reported that the gunman ran through the mall near the Olympic stadium in the southern German city, firing on several people before fleeing in the direction of a nearby metro station.

The DPA news agency, citing a Munich police spokesman, said several people were dead.

Europe has been on alert for terrorism in the wake of a string of attacks.

The OEZ shopping centre was surrounded by police who were hunting for the attacker, the paper said.

"There is a major police operation under way in the shopping centre," Munich police said on Twitter, urging people to avoid the area.

Emergency vehicles were seen in the streets outside, as passers-by looked on.

"Attention -- avoid the neighbourhood around the OEZ. Stay in your homes. Leave the street," the Munich police tweet said.

Germany has so far escaped the kind of large-scale jihadist attacks seen in neighbouring France.

Axe rampage

But the shooting comes just days after a teenage asylum seeker went on the rampage with an axe and a knife on a regional train in Germany on Monday, injuring five people, two of them critically.

Interior Minister Thomas de Maiziere said the teenager was believed to be a "lone wolf" attacker who appeared to have been "inspired" by the Islamic State group but was not a member of the jihadist network.

Authorities said he shouted "Allahu akbar" (God is greatest) three times as he rampaged through the train carriage.

The attacker is believed to be either Afghan or Pakistani and investigators are still trying to determine his identity.

The train rampage triggered calls for Germany to impose an upper limit on the number of refugees coming into the country.

The assailant had arrived as an unaccompanied minor in Germany in June 2015 and had been staying with a foster family in the region of the attack for the last two weeks.

A record 1.1 million migrants and refugees were let in to Germany last year, with Syrians making up the largest group followed by Afghans.

In the latest attack in France, 31-year-old Mohamed Lahouaiej Bouhlel used a truck to mow down 84 people, including children, in the Riviera city of Nice last week.

It was the third major attack on French soil in the past 18 months, after the jihadist carnage in Paris in November and the shootings at satirical magazine Charlie Hebdo and a kosher supermarket in January 2015.

In March, Islamic State-claimed suicide bomb attacks at Brussels airport and a city metro station left 32 people dead.