Police told AFP the man had used a "sharp weapon," while local media reported he had brandished a knife.
The incident was initially treated as "attempted murder" but police later changed it in a statement to include a "suspected terrorist crime," without giving further details.
Police did not specify the man's nationality, but according to several media reports, he was originally from Afghanistan and arrived in Sweden in 2018.
Three of those attacked were said to have suffered life-threatening injuries, while two others were in a serious condition, according to the local health authority in Jonkoping, where they were being treated in hospital.
Regional police chief Malena Grann later clarified that a preliminary investigation was still under the designation "attempted murder," but details had emerged that meant they were also looking into "potential terror motives."
Grann said: "There are details in the investigation that have led us to investigate whether there was a terror motive."
She added that the police were working closely with the Swedish intelligence service Sapo.
The suspect was a resident of the area and previously known to police, but in the past had only been accused of "petty crimes," including small-scale cannabis use, according to local press.
The extent of his injuries were also unknown but police said they believed they would be able question him.
Sweden's Prime Minister Stefan Lofven condemned the "horrific violence" in a Facebook statement: "We face these despicable actions with the combined force of the community. We are reminded of how frail our safe existence is."