(CNN) German Chancellor Angela Merkel on Thursday described recent attacks in the country and across Europe as "shocking, depressing and terrifying," but she refused to back down from an open-door refugee policy that has attracted fierce criticism following recent assaults in the country.

Germany has been rattled by four attacks in the past two weeks, three of which authorities say have been carried out by asylum seekers or refugees inspired by Islamist extremism.

The attacks have given way to mockery by some Germans as well as foreigners, who have dubbed the recent weeks of bloodshed on social media as #MerkelSommer, or even "Merkel's summer of slaughter."

One Twitter user posted a pair of hands covered in blood, quoting Merkel with, "We have already accomplished a lot," using the #MerkelSommer hashtag.

Merkel vowed to boost security and improve counterterrorism measures, but she stood firm on Germany's position of accepting nearly all asylum seekers found to be legitimate refugees. Germany took in more than 1 million refugees in 2015, making it the most open country in Europe to asylum seekers.

I'm so done with her politics #Merkelsommer — Sandra (@Sandruschkaa) July 25, 2016

"We decided to fulfill our humanitarian tasks," she told reporters at a news conference, according to a translator. "Refusing humanitarian support, that would be something I wouldn't want to do and I wouldn't recommend this to Germany."

She said that terrorists wanted Germany to "lose our view for what's important to us."

An asylum seeker takes a selfie with German Chancellor Angela Merkel during the leader's visit to refugee registration centre in Berlin on September 10, 2015.

"They want to divide our unity, our cooperation, they want to harm our life," she said. "They want to prevent our openness to welcoming people. They spread hate between cultures and also among religions."

'Anxiety and fear'

Merkel added, "We are being tested in the way we live. Our understanding of freedom and security is being tested."

But she said that Germany had faced such challenges before, repeating the phrase "We can do it" several times.

"Anxiety and fear can't advise our political decisions," she said.

Photos: Germany train attack Police stand by a regional train in Wurzburg, Germany, on Monday, July 18, after authorities said a man attacked passengers with an ax. German police shot the man dead in a confrontation after he fled the train. Four passengers who were attacked are in serious condition, police said. Hide Caption 1 of 6 Photos: Germany train attack Blood stains and a rescue blanket appear through the windows of the train in Wurzburg. The attacker was identified as a 17-year-old Afghan man living in Ochsenfurt, Germany. Hide Caption 2 of 6 Photos: Germany train attack Rescuers gather on a road near railroad tracks in Wurzburg. The attack took place as the train was traveling between Treuchtlingen and Wurzburg. Police said the train made an emergency stop short of the station at Wurzburg-Heidingsfeld, where the assailant jumped off and fled into a nearby town. Hide Caption 3 of 6 Photos: Germany train attack A rescuer stands on a road near the railroad tracks in Wurzburg. Hide Caption 4 of 6 Photos: Germany train attack A police officer enters the Kolping House in Ochsenfurt on Tuesday, July 19, where the attacker reportedly lived with other refugees until two weeks ago. The attacker came to Germany without his parents a year ago, police said. Hide Caption 5 of 6 Photos: Germany train attack Officers walk along train tracks in Wurzburg on July 19, a day after the attack. German authorities said they had found a hand-drawn flag resembling the one used by ISIS among the Afghan man's belongings. A pro-ISIS media group said the attacker was an "ISIS fighter," but authorities cast doubt on that claim. Hide Caption 6 of 6

But she added that those who came to Germany as refugees but then carry out attacks "mock the country that took them in."

"We have to do more to [combat] the causes of migration," she said.

At the same time, she said Germany must improve the process for repatriation of migrants whose asylum applications had been rejected. International treaties, however, forbid countries from returning migrants to places of danger, such a war-ravaged Syria, even if a migrant has been refused refugee status.

ISIS infiltrates the refugee route

Merkel acknowledged that terror groups like ISIS have been able to penetrate the migrant route through Europe used by refugees to flee places of conflict, like Syria.

"We do know that the Islamic State use the refugee movements, that they ... have used it to also make it possible for terrorists to enter. We of course try to limit this kind of movement," Merkel said.

A migrant boy wrapped in an EU flag arrives from Austria to Munich, Germany, on September 5, 2015

"There is another risk of perpetrators that have not come to the attention of authorities. We need an early warning system so that authorities can act as soon as ... it turns out there is some radicalization."

A 27-year-old Syrian suicide bomber on Sunday attacked a music festival in the city of Ansbach, killing only himself but injuring 15 others. He had applied for asylum in Germany but had been rejected because he had an asylum application already pending in Bulgaria, German authorities said. He had been informed two weeks earlier that he was to be deported in 30 days.

A worker walks through a container facility under construction in the Zehlendorf district in Berlin that will house refugees and asylum seekers

Just hours before that attack another 21-year-old Syrian asylum seeker killed a woman in Reutlingen, attacking her with a knife nearly two feet in length.

Germany was already reeling from a shooting spree in Munich on Friday by an 18-year-old German-Iranian that left nine people dead. That attacker was not an asylum seeker, however. He was born and raised in Munich.

And last Monday, a 17-year-old carried out an ax attack on board a train outside of Wurzburg. Authorities have said he was a refugee, but there has been confusion over whether he was from Afghanistan or Pakistan.

JUST WATCHED Wave of Violent Attacks Rattle Germany Replay More Videos ... MUST WATCH Wave of Violent Attacks Rattle Germany 02:56

Europe reels from attacks

Germany is not the only European country dealing with a wave of terrorist attacks. France has been repeatedly targeted by terrorists since January 2015, when Islamist gunmen stormed the office of satirical magazine Charlie Hebdo and gunned down 12 staff members over cartoons of the Islamic prophet Muhammad.

That was followed by attacks in Paris in November that left 130 people dead. Earlier this month, a man drove a lorry through a crowd celebrating France's Bastille Day holiday in Nice, killing 84 people. He had pledged allegiance to ISIS.

Brussels was also hit in March when Islamist militants bombed the airport there, killing 32 people and injuring at least 300 more.

Europe has at the same time been dealing with the biggest influx of refugees in its history as the Syrian war shows little sign of letting up, and as immigrants from African nations like Eritrea continue to flee oppressive regimes.

The Soufan Group, a New York-based intelligence consulting firm that tracks "foreign fighters" who have joined ISIS, said in a brief Thursday that ISIS-inspired attacks outside Iraq and Syria were "becoming an unprecedented global phenomenon," even without the returning foreign jihadists.

"In the last seven days, more than 80 people have been arrested for Islamic State-related offenses, from Florida to Malaysia, Morocco to Brazil," according to the Soufan Group.

Law enforcement and intelligence agencies throughout the world are struggling with the threat of attacks not only from people with little to no affiliation with ISIS but from returning foreign fighters, the consulting firm said.