The monocled cobra was sighted at the entrance to a basement. (AFP)

A deadly cobra that escaped, terrifying a German community, was captured Friday after five days on the loose.

The monocled cobra was sighted at the entrance to a basement, and a snake expert came and trapped the animal, a local official said.

The over one metre (three foot) long Asian serpent had escaped Sunday, sparking panic among nearby residents in the western town of Herne.

Four houses were temporarily evacuated and their inhabitants told to keep windows closed and avoid long grass and dense vegetation.

Emergency services had tried to track the cobra by spreading flour in the buildings under surveillance in the hope it would leave a trail.

During the search, medical personnel were on standby with an antidote to the snake's powerful venom.

The owner from whose collection the animal escaped has had around 20 other snakes seized since raising the alarm.