Recent attacks in Germany involving asylum-seekers would not change its willingness to take in refugees, Chancellor Angela Merkel has said.
She said the attackers "wanted to undermine our sense of community, our openness and our willingness to help people in need. We firmly reject this".
But she did propose new measures to improve security.
These include information sharing, deciphering web chatter and tackling arms sales on the internet.
Two recent attacks in Bavaria were both by asylum seekers. A suicide bomb attack in Ansbach on Sunday that injured 15 people was carried out by a Syrian who had been denied asylum but given temporary leave to stay.
An axe and knife attack on a train in Wuerzburg on 18 July that wounded five people was carried out by an asylum seeker from Afghanistan.
Both men had claimed allegiance to so-called Islamic State.
The deadliest recent attack - in Munich on 22 July which left nine dead - was carried out by a German teenager of Iranian extraction but was not jihadist-related.
The suicide attacker in Ansbach targeted crowds attending a music festival - he injured 15 people
Mrs Merkel, who interrupted her summer holiday to hold the news conference in Berlin, said the asylum seekers who had carried out the attacks had "shamed the country that welcomed them".
But she insisted that those fleeing persecution and war had a right to be protected, and Germany would "stick to our principles" in giving shelter to the deserving.
Referring to the attacks that have taken place in France, Belgium, Turkey, the US and elsewhere, she said "taboos of civilisation" had been broken, and they were intended to "spread fear and hatred between cultures and between religions".
But in reference to her famous phrase "Wir schaffen das" or "We can do this" - uttered last year when she agreed to take in a million migrants - Mrs Merkel said: "I am still convinced today that "we can do it".
"It is our historic duty and this is a historic challenge in times of globalisation. We have already achieved very, very much in the last 11 months".
An Afghan asylum-seeker injured five people in an axe attack on this train in Bavaria
Mrs Merkel said that "besides organised terrorist attacks, there will be new threats from perpetrators not known to security personnel".
To counter this, she said: "We need an early alert system so that authorities can see during the asylum request proceedings where there are problems."
Mrs Merkel added: "We will take the necessary measures and ensure security for our citizens. We will take the challenge of integration very seriously."
A week of bloody attacks has frayed nerves in Germany, which led the way in accepting asylum seekers from Syria. To date, two of the attacks have been linked to a militant group: