Eighteen-year-old Abderrahman Mechkah has appeared before a court via a video link to admit a knife attack that left two women dead and eight other people wounded in the Finnish city of Turku.
Finland's prime minister has described the stabbings as the country's first terrorist attack.
However, the teenager denied murder and said there was no terrorist motive.
Three other suspects, all Moroccans, have been remanded in custody in connection with the 18 August attack.
Another man was released without charge.
Police said they were still searching for another suspect and trying to find out if the stabbings were planned from abroad.
The attack unfolded in the market square in Turku last Friday, a day after another Moroccan, Younes Abouyaaqoub, murdered 13 people on Barcelona's Las Ramblas boulevard.
A man wielding a knife repeatedly stabbed one woman in the neck before running around, targeting other people, mainly women, nearby. Two of his victims died.
Within minutes Finnish police had shot Abderrahman Mechkah in the leg and arrested him. Two of those wounded by the attacker are still in intensive care in hospital.
What do we know about Abderrahman Mechkah?
- Held in Germany in 2015 on suspected immigration offences, also for alleged violence
- Used false identities and his true name may not be known
- Arrived in Finland in spring 2016
- Appealed after his asylum claim reportedly rejected
- Had been living in asylum centre in Turku
- Known to Finnish intelligence after a tip-off but was not being monitored
After the hearing at Turku district court on Tuesday, Finland's National Bureau of Investigation issued a statement saying that the chief suspect had been "detained on a probable ground for two murders with terrorist intent and eight attempted murders with terrorist intent".