A police spokesperson said one man was injured after being shot in the leg by an officer near the Urban Hospital in the city's Kreuzberg district on Thursday.

The spokeswoman, Konstanze Dassler, said the incident occurred shortly after 4pm local time (14:00 UTC).

The attacker had "approached three policemen in front of the Kreuzberger Urban hospital" without speaking and had threatened them with what they believed was a gun, a police official told the French press service AFP later on Thursday.

"An officer shot and injured the attacker in the lower part of the body," the spokeswoman said.

The attacker had approached the officers as they were leaving the hospital and were on their way to their car, the spokeswoman added. Police had been called to the hospital in connection with a different matter.

Berlin police later tweeted that the man had ignored repeated requests to stop his threats.

Officials said the man is receiving medical treatment at the hospital, and his condition is not life threatening.

The local public broadcaster RBB described how two officers were leaving the hospital after attending a separate investigation when the man approached them and pulled a gun for no apparent reason.

The man is already known to police for weapons offenses, RBB reported.

The broadcaster said police are now checking whether his gun was real. "It looked like a gun," the police spokeswoman said.

The attacker's motives are unclear, she added. "So far we have no insights into what motivated him to attack."

Police have increasingly used firearms in the German capital recently to defuse security threats.

Earlier this month, an armed woman was shot by police in the Friedrichshain district of Berlin. She suffered injuries to her arm and thigh.

In January, police shot a 25-year-old man close to his home in Hohenschönhausen. He was armed with a knife and threatened to use it on nearby residents.

Berlin remains on high alert following the Christmas market attack that left 12 people dead last December. The atrocity was carried out by a Tunisian man who pledged allegiance to the so-called "Islamic State" (IS) armed group.

sms/mm/jbh (dpa, AFP)