Police officers were "harassed and attacked" while trying to retrieve a body from the Regensburg asylum center on Saturday, German authorities said.

Emergency services were called after a 31-year-old Nigerian woman died in the building. The cause of death was unknown and a "topic of police investigation," but there was no immediate indication of foul play. When the police tried to take the body out of the building, some 40 to 50 residents engaged in a standoff with the officers, threatening them and then pelting them with glass bottles and stones.

Read more: German government defends plans for immigration laws

"A part of the residents of the facility responded with increasing emotions to the presence to of the investigators," police spokesman Dietmar Winterberg said. It was not immediately clear why the situation escalated, but police said one explanation was linked with the fact that the officers barred them entry to the area where the woman had died.

Read more: Germany passes refugee migration 'stress test'

The standoff ended after some three hours, with strong police forces deploying to the Regensburg home. The authorities eventually managed to take the body out of the home. No injuries were reported.

The 31-year-old Nigerian left behind three children between the age of nine and three. The children would now enter the state child care system.

The Regensburg facility is one of several so-called Anker shelters across Germany which serve to house the asylum seekers until their status is resolved, and they are either relocated to local communities or deported.

Watch video 02:34 Share Living with the threat of deportation Send Facebook google+ Whatsapp Tumblr linkedin stumble Digg reddit Newsvine Permalink https://p.dw.com/p/2ztAF Building a life in Germany despite threat of deportation

dj/aw (AFP, epd, dpa, AP)

Every evening, DW sends out a selection of the day's news and features. Sign up here.