COPENHAGEN — As part of the prolonged national headache caused by a Danish newspaper’s decision to publish 12 caricatures of the Prophet Muhammad in 2005, last weekend’s attack on one of the cartoonists responsible had a certain awful inevitability about it.

Once again, the motivation was fury, still fresh after all this time, over the dissemination of the cartoons. And once again, the circumstances — in this case, the news that the person accused of the attack was a Muslim immigrant suspected of having links to terrorists — has led Danes into an uneasy examination of their relationship to their Muslim population.

In a country that already has one of the strictest immigration policies in Western Europe, the attack has also spurred politicians from across the political spectrum to demand ever more stringent rules about who should be allowed to live here.

“I’m sorry to say, but it’s déjà vu — every time we experience an episode, then in 10 minutes we have them saying we have to have a new law,” said Naser Khader, a member of Parliament and the spokesman on foreign affairs and immigration for the Conservative People’s Party. He was speaking of the increasingly powerful Danish People’s Party, whose votes the government relies on to pass legislation and whose populist, anti-immigrant rhetoric has informed and inflamed debate in recent years.

After the attack, the People’s Party leader, Pia Kjaersgaard, said that it should be easier to deport Danes linked to terrorists. “It must be crystal clear to everyone in this country that we cannot accept having Islamists who associate with terror being more or less tolerated in this country,” she said.

Mr. Khader is just as hostile toward Islamists as anyone in Danish politics; he recently proposed banning burqas. But he said the latest comments had gone too far. “You have to be responsible when such incidents happen, and not let emotions take over,” he said.

New details about the suspect in the attack on the cartoonist, 74-year-old Kurt Westergaard, have increased complaints that the security service has been lax in monitoring people suspected of being terrorist sympathizers.

The attack took place late last Friday when Mr. Westergaard was threatened in his townhouse in Aarhus, Denmark’s second largest city, by a man carrying a knife and an ax. Mr. Westergaard has been a focus of Muslim ire since drawing perhaps the most provocative of the 12 cartoons, showing Muhammad wearing a turban shaped like a bomb. He fled into a locked safe room and summoned the police with a panic button.

The suspected assailant, 28-year-old Muhudiin Mohamed Geele, was charged with two counts of attempted homicide, on Mr. Westergaard and on a police officer, and has pleaded not guilty.

Mr. Geele arrived in Denmark in 1995, a refugee from the civil war in Somalia, the authorities said, and the next year was granted indefinite leave to remain. He lived in the city of Aalborg and, as a boy, was a role model for others in a youth club there, said Nuuradiin Hussein, who worked at the club.

“He was one of my favorite boys at the club,” said Mr. Hussein, who is now a social worker. “Most of the boys his age wanted to talk about girls and football, but he wanted to talk about the future and about getting an education.”

Mr. Geele married and had three children, and at some point, according to the Danish Security and Intelligence Service, known as PET, developed ties to the Shabab, a Somali terrorism organization, and to Al Qaeda in East Africa.

He also began making frequent trips abroad. Last summer, he was detained by the authorities in Nairobi, Kenya. The proximate cause was that he had lost his passport, but intelligence officials said he also was believed to have connections to suspects in a plot to blow up several buildings, including a hotel where Secretary of State Hillary Rodham Clinton was staying.

Nicholas Kamwende, head of Kenya’s antiterrorism police, said that the Kenyan authorities verbally shared “intelligence information” about him with the Danish Embassy.

“We told them, ‘He is a dangerous man,’ but their reaction was negative,” Mr. Kamwende said in an interview.

In an interview with the newspaper Jyllands-Posten, Mr. Geele’s now ex-wife said that PET had tried to recruit him in 2006.

“The police wanted him as an informant,” she told the newspaper, “and he became sad and more and more introverted. The police thought that he had participated in combat actions in Somalia against Ethiopian forces, and that he traveled back and forth to take part in war. But he had only been in Somalia in 2005 to visit the family.”

Officials declined to say whether the agency had indeed made overtures to Mr. Geele, but said that it was normal for PET to conduct “interviews with individuals that may be of interest to the service.” And Jakob Scharf, the director general, said that there had been no evidence that might have been “deemed sufficient grounds for arresting, prosecuting or expelling” him, despite his suspected terrorism links.

More recently, Mr. Geele had been living in an apartment in a down-at-heel housing project of concrete buildings typical of an immigrant neighborhood, about seven miles from central Copenhagen.

Residents said that Mr. Geele had been renting a room in an apartment owned by an Egyptian taxi driver and that he was known for his religious convictions — one neighbor said he had been asked several times to turn down music and recordings of the Koran — and also for being, at least at first, aloof and unfriendly.

After the arrest, the police spent more than eight hours searching the apartment, neighbors said.

What the attack on Mr. Westergaard shows perhaps more than anything is how the publication of the cartoons has irrevocably changed Denmark’s place in world affairs. The damage was compounded in 2008, when in response to a separate plot to kill Mr. Westergaard, all of Denmark’s major newspapers reprinted the cartoons.

It was then that Osama bin Laden denounced the cartoons as part of “a crusade” against Islam, and other Qaeda officials called on Muslims to make Denmark a target of their fury. That June, a suicide bomber in Islamabad, Pakistan, killed eight people at the Danish Embassy.

In the latest manifestation of Denmark’s troubles, the Sudanese government on Tuesday publicly denounced “The Revenge,” a movie about the Sudanese war by the Danish filmmaker Susanne Bier. The government compared the film — which has not yet been screened, and which is due to be released this summer — to the cartoons.

Each new incident forces the more extreme circles of both the anti-immigrant and Islamist groups to become more deeply entrenched in their positions, said Ole Waever, a professor of international relations at the University of Copenhagen. Meanwhile, as the rhetoric grows ever more strident, he said, Denmark’s sense of itself is being sorely tested.

“There’s a strange dialectic in the reaction,” Mr. Waever said in an interview. “There is an identity crisis where we can no longer recognize ourselves. This view of ourselves as a liberal, relaxed society no longer fits the reality.”

Walter Gibbs contributed reporting from Oslo, Johan Spanner from Copenhagen, and Reuben Kyama from Nairobi, Kenya.

http://www.nytimes.com/2010/01/07/world/europe/07denmark.html?ref=todayspaper&pagewanted=print

Copyright 2010 The New York Times Company