By Anna Ringstrom and Esha Vaish

STOCKHOLM (Reuters) - An explosion thought to have been a bomb rocked a residential street in the town of Linkoping in southern Sweden on Friday, damaging several buildings and slightly injuring about 20 people, police officials said.

A police bomb squad was investigating the scene of the huge blast, which destroyed the windows and balconies of a five-story residential building and shattered windows on several neighboring buildings.

"We do not know what it is that detonated, but it is clearly some sort of explosive device. The preliminary location is outside the building, not in the building," Magnus Skoglund, the head of the police investigation, told a news conference.

"We do not see it as an act of terror," he said.

He said that the police had a working hypothesis as to who was targeted in the blast but that they were pursuing a broad line of inquiry in their investigation.

Pontus Johansson, a 21-year-old engineer who lives in a building nearby, said he was in the shower when he heard a loud bang.

"First I didn't think it was anything bad, then I saw the neighbor's window was broken so I left our apartment and saw the chaos outside," he told Reuters.

Several blocks around the site of the blast remained cordoned off on Friday afternoon. Police said around 20 people had sustained minor injuries in the explosion, while regional authorities said two people remained hospitalized.

There have been several cases in recent years of explosives being used in suspected gang-related attacks in Sweden, and spokeswoman Asa Willsund said the police were looking into whether the blast was connected to local criminal groups.

(Additional reporting Helena Soderpalm, Johannes Hellstrom, Simon Johnson; writing by Niklas Pollard; Editing by Catherine Evans, Raissa Kasolowsky and Hugh Lawson)