Police have cordoned off a Chinese restaurant in a Madrid suburb where an armed policeman is threatening to kill himself.

Spanish news agency Europa Press says the policeman entered the restaurant at lunchtime Tuesday, took out his firearm and said he was going to commit suicide.

The agency says customers and staff escaped, leaving the man alone inside the establishment in the Alcobendas area north of the Spanish capital. The agency quoted unidentified police sources.

It said police negotiators and psychologists were at the scene.