TURKU, Finland — A young Moroccan man has admitted to his role in a deadly stabbing rampage last week, which the authorities have called Finland’s first terrorist attack in decades, officials announced on Tuesday.

Police said that the man — who has been tentatively identified as Abderrahman Mechkah, 18, and who appeared in court here on Tuesday via a video feed from his hospital bed — had admitted to the stabbings.

But Chief Inspector Olli Toyras, a police detective, told journalists that much was unclear: whether Mr. Mechkah acted alone, whether his actions were guided or influenced by someone else and even his true name and age.

Finnish officials said Mr. Mechkah was believed to have arrived in Finland in the spring of 2016, after living several months in Germany. He is believed to have used several aliases. He was denied asylum at the beginning of this year.