COPENHAGEN (AP)  The police foiled an attempt to kill an artist who drew a cartoon depicting the Prophet Muhammad that sparked outrage in the Muslim world, the head of Denmark’s intelligence service said Saturday.

Jakob Scharf, who heads PET, the Danish intelligence service, said a 28-year-old Somalia man was armed with an ax and a knife when he tried to enter the home of the artist, Kurt Westergaard, in Aarhus on Friday evening.

The attack on Mr. Westergaard, whose rendering was among 12 that led to the burning of Danish diplomatic offices in predominantly Muslim countries in 2006, was “terror related,” Mr. Scharf said in a statement.

“The arrested man has according to PET’s information close relations to the Somali terrorist group, Al Shabab, and Al Qaeda leaders in eastern Africa,” he said.