The Turku district court placed Abderrahman Mechkah, an 18-year-old Moroccan citizen.
The Turku district court placed Abderrahman Mechkah, an 18-year-old Moroccan citizen, in formal custody after he made his statement to the court via video link from hospital, where he is being treated for a police gunshot wound to the thigh.
"The main suspect admits acts which led to deaths, but denies that they were murders," his lawyer Kaarle Gummerus told AFP.
The stabbing is being investigated as Finland's first terror attack.
"The offender in Turku incident is suspected on probable cause of murders and attempted murders with terrorist intent and placed in detention," the National Bureau of Investigation (NBI) said in a Twitter post.
"He didn't explain the motive of the acts," Gummerus added.
Police have said that Mechkah -- an asylum seeker who arrived in Finland in early 2016 -- targeted women in the Friday rampage at a market square in the southwestern port city of Turku.
Two Finnish women were killed and six women and two men were injured. Among the injured were a Briton, an Italian and a Swede.
Mechkah was shot by police minutes after the attack.
Most of the hearing was held behind closed doors, but press photos taken of the video screen at the beginning showed the suspect lying in his bed, his head propped up on pillows and his face shielded by a white sheet.
The country's intelligence agency SUPO said Monday that it had received a tip earlier this year that Mechkah might have become radicalised.
Because the tip did not contain information about a concrete threat of an attack, it had not yet been investigated, the agency said.
In June, the SUPO raised Finland's terror threat level one notch, to "elevated" from "low", the second on a four-tier scale.
It said at the time that it saw an increased risk of an attack committed by Islamic State group militants, noting that foreign fighters from Finland had "gained significant positions within IS in particular and have an extensive network of relations in the organisation."
The agency reiterated on Monday that it was closely watching around 350 individuals -- an increase of 80 percent since 2012.
Four other Moroccan citizens were arrested in a raid in Turku just hours after the attack.
On Tuesday, the Turku court placed two of them, Mohamed Bakier and Ilyas Berrouh, in custody.
The nature of the two men's involvement in the attack has not yet been made public.
A third, identified as Abdederrazak Essarioul, was also due to appear before the court later Tuesday, suspected of being an accessory to the crimes.
Meanwhile, the fourth man remains a suspect but police said Tuesday that they had released him and would not seek his detention.
Germany's interior ministry has said that Mechkah spent time in Germany from late 2015 to early 2016.
He had been registered in a German police database because his stay in the country was illegal, since he had not sought asylum there.