The hostage was taken to a hospital after her ordeal, but it wasn't clear if the suspect harmed her or if she was injured when a special police unit stormed the train station pharmacy where she was held to free her.
Before getting into the pharmacy, the man lit a Molotov cocktail inside a restaurant at the station, Cologne police said. A 14-year-old girl was hospitalized with burns and a woman at the restaurant was treated for smoke inhalation, police said.
"Witnesses told us that the attacker said he belonged to the Islamic State group as he was entering the restaurant, but we cannot confirm this," Cologne Police Marshal Klaus Rueschenschmidt said during a news conference.
The suspect underwent surgery Monday night for life-threatening injuries, including gunshot wounds.
Investigators said they found gas cartridges inside the the pharmacy's backroom and an ID card for a 55-year-old Syrian citizen. They said the ID likely was the suspect's, but police didn't divulge the name on it.
A person with that name came to Cologne in 2016 and was known to local law enforcement for burglary and other previous crimes, as well as for drug-related incidents, they said.
During negotiations over the hostage, the man asked for the release of a Tunisian woman and demanded to be allowed to leave the train station unimpeded, Rueschenschmidt told reporters.
Police said it would likely take a while to get a full picture of what happened at the train station and why.
Before police stormed the pharmacy, the entire train station, one of the biggest in Germany, was evacuated. All train traffic was stopped, leading to delays and cancelations across western Germany.
The station was reopened on Monday night, but service remained delayed.
Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.