The 18-year-old suspect, Abderrahman Mechkah, “was in Germany in late 2015, early 2016," said interior ministry spokeswoman Annegret Korff. "He didn't apply for asylum."
German authorities were in close contact with their Finnish counterparts over the case, the ministry said.
Finnish court documents on Monday identified the Mechkah as the suspect the stabbing spree in the town of Turku, with the country's intelligence agency saying he may have been radicalised.
He targeted women in the attack at a market square in the southwestern port city. Two people were killed and eight were injured. The stabbing is being probed as Finland's first-ever terror attack.
Finnish police had previously described the suspect as an asylum seeker from Morocco, though the court documents did not mention his nationality.
The timing of Mechkah's stay in Germany was picked up on social media by critics of Chancellor Angela Merkel's refugee policy.
In September 2015 Germany effectively opened its borders to asylum seekers without registering them upon entry. The decision led to several hundred thousand people fleeing war-torn Syrian being provided refuge. But asylum seekers have also been suspects in a string of terror attacks in Germany and other countries.
"Once again Germany is serving as a stepping stone for terror in Europe and the EU," one commentor wrote on Twitter on Monday.
The motive for the most recent attack remains unclear. But the Finnish intelligence agency SUPO said Turku police had received a tip early this year that Mechkah "appeared... to have been radicalised and showed interest in extremist ideologies."
Questioned by AFP, SUPO spokeswoman Verna Leinonen said the agency "could not comment on" whether the alleged radicalisation concerned Islamist extremism, nor how he may have been radicalised.
The tip, which had been forwarded to the SUPO, "contained no information about any threat of an attack."
Mechkah, whom police shot in the thigh while arresting him minutes after the rampage, is to appear before the Turku court on Tuesday via video link from hospital, the National Bureau of Investigation (NBI) said.
His court appearance had initially been scheduled for Monday.
Police will ask the court to remand him in custody on suspicion of two murders and eight attempted murders "with terrorist intent".
Investigators said Sunday that they had interrogated the suspect for the first time, but disclosed no information about the outcome.
Police will also request the detention of four Moroccan citizens who were arrested in an overnight raid on a Turku apartment building and refugee housing centre just hours after the attack.
"They are suspected of participation in the murders and attempted murders committed with a terrorist intent. They deny any involvement in the offences," the NBI said.