BERLIN — The 29-year-old Canadian wanted in a bizarre and grisly murder in Montreal was arrested in Berlin on Monday, after eluding Canadian and European authorities for days.

The police said they were tipped off by a Berlin resident who had been following the frenzied media coverage of the case and spotted the suspect, Luka Rocco Magnotta, at an Internet cafe in the Neukölln district. A cafe employee said the tipster saw Mr. Magnotta reading news stories about himself, made the connection and went outside to flag down a passing patrol car.
The suspect is to be handed over to German federal prosecutors. Speaking to reporters in London, Prime Minister Stephen Harper of Canada, congratulated the Berlin police.
Commander Ian Lafranière, a Montreal police spokesman, said it would take at least several weeks for Mr. Magnotta to be extradited to Canada.
Mr. Magnotta is wanted for first-degree murder and other charges in the slaying and dismemberment of Jun Lin, who had come from Wuhan, China, to study at Concordia University in Montreal. The authorities said the two men had had a relationship but would not discuss its nature. They had no explanation for the gruesomeness of the murder, which Mr. Magnotta videotaped.
The case first drew attention last week, when a staff member of Canada’s Conservative Party received a package, decorated with a crudely drawn red heart, that contained a severed foot. That same day, a janitor in Montreal found a suitcase containing a torso near a small apartment building where, it was later determined, Mr. Magnotta had lived. A parcel addressed to the Liberal Party of Canada, found later at a sorting station in Ottawa, contained a hand.
Tests determined that the parts all belonged to one victim. His other hand and foot were found in the apartment but other body parts remain missing.
A native of the Toronto suburb of Scarborough, Mr. Magnotta legally changed his name from Eric Clinton Kirk Newman in 2006. The police said he also went by Vladimir Romanov. He often changed his appearance, as well. One photograph in his arrest warrant showed him posing in a T-shirt with black hair worn short and spiky; another showed him wearing lipstick and a pout, with longer, tousled hair.
Newspapers in Canada, Britain, France and Germany have been digging up details from what appear to be his online personas, including protagonists from vampire and mystery films. What emerged was a portrait of a man who has claimed to have worked as a model, a stripper and an actor in adult films. Accusations emerged in 2010 that he had posted at least four video recordings of himself killing kittens.
The authorities were trying to trace the exact into the details of Mr. Magnotta’s movements in Europe. He apparently traveled here from Paris, where the police had used his cellphone as tracking beacon but arrived at a hotel shortly after he had left.
“We are trying to find out where he was staying, just to be sure that he did not leave anything behind,” said Guido Busch, a spokesman for Berlin police.
Commander Lafrenière said the Montreal police were continuing their investigation to determine if Mr. Magnotta had committed other crimes in Canada.
Ian Austen contributed reporting from Ottawa, Canada.