BERLIN -- Chancellor Angela Merkel pledged Thursday to do "everything humanly possible" to ensure security in Germany following a string of attacks - including two carried out by asylum-seekers and claimed by the Islamic State of Iraq and Syria (ISIS) group, which she said mocked the country that took in the assailants.

Merkel promised at a news conference to do everything to clear up the "barbaric acts," find out who was behind them and bring them to justice. Germany owes that not just to victims and relatives and other Germans, but also to other refugees, she said.

The attacks have brought Merkel's policy of welcoming refugees under renewed criticism. More than 1 million came to Germany last year, although the influx has since slowed dramatically.

Merkel said that Germany will "stick to our principles" and give shelter to those who deserve it. She said, though, that the fact two men who came to Germany seeking shelter carried out attacks claimed by IS "mocks the country that took them in."

Get Breaking News Delivered to Your Inbox

Merkel said she will stick to her insistence last year that Germany "will manage" the challenges it faces. The government, she added, "will do everything humanly possible to ensure security in our free, democratic state of law."

"The fact that the events caused great insecurity ... fear, isn't in question. But fear can't be a good counsel for political action," she said.

The chancellor cut short her vacation this week to hold her annual summer news conference. She had faced criticism from opponents for her muted response to four violent attacks that shook the country over the past 10 days.

Also on Thursday, Bavarian officials pledged to hire hundreds of extra police officers and urged tougher background checks on asylum-seekers as they presented an anti-terror plan following the four attacks.

Bavarian Interior Minister Joachim Herrmann said his state - where three of the four attacks took place - would hire some 2,000 additional police officers by 2020, improve police officers' equipment and create new offices to fight Muslim extremism and cybercrime.

He also called for tougher background checks on asylum-seekers and new strategies to deport criminal asylum-seekers more easily. Three of the four attacks were committed by asylum-seekers.

Merkel said of the plan that "there are a lot of things on which we agree."

Two of the attacks - an ax attack near Wuerzburg that wounded five and a suicide bombing that injured 15 outside a bar in Ansbach - were the first in Germany to be claimed by the Islamic State group. Both of the attackers were killed.

In two other attacks - a mass shooting in Munich that claimed 10 lives, including the attacker's, and the stabbing of a woman at a restaurant in Reutlingen - the motive is still unclear but Islamic extremism is not suspected.