SOLINGEN, GERMANY -- A man suspected of a stabbing rampage in the western German town of Solingen has been taken into police custody, a state official told German television on Saturday, some 24 hours after the attack that killed three people.

North Rhine-Westphalia's interior minister Herbert Reul told the ARD broadcaster that he was "a bit relieved" after authorities spent the day following a "hot lead" that led to the arrest.

The Islamic State group earlier claimed responsibility for Friday's knife attack that also wounded eight people.

Police spent the day conducting a manhunt, making two arrests that were likely not the perpetrator, Reul said.

"The real suspect is the one that we’ve arrested just now," he said. The individual is being questioned and evidence was seized, he said.

Reul said the man was affiliated with a home for refugees that had been searched earlier in the day.

Police declined to immediately comment.

Describing the man who carried out the attack as a "soldier of the Islamic State," the militant group said in a statement on its Telegram account: "He carried out the attack in revenge for Muslims in Palestine and everywhere."

It did not immediately provide any evidence for its assertion and it was not clear how close any relationship between the attacker and Islamic State was.

Hendrik Wuest, premier of the state of North Rhine-Westphalia, described Friday evening's attack during a festival in the city as an act of terror.

"This attack has struck at the heart of our country," Wuest told reporters.

Germany knife attack festival grounds

The attack took place in the Fronhof, a market square in the western German city where live bands were playing as part of a festival marking the its 650th anniversary.

Markus Caspers, an official with the public prosecutor’s office in Duesseldorf, said authorities were treating the attack as a possible terrorist incident because there was no other known motive and the victims seemed unrelated.

A police official, Thorsten Fleiss, said the assailant appeared to aim for his victims' throats.

"The perpetrator must be quickly caught and punished to the fullest extent of the law," Chancellor Olaf Scholz said in a post on X.

Police cordoned off the square on Saturday and passers-by placed candles and flowers outside the barriers.

"We are full of shock and grief," Solingen Mayor Tim-Oliver Kurzbach told journalists.

A German musician who goes by the name Topic said he was playing on a nearby stage when the incident occurred. He was told about what had happened but was asked to keep playing "to avoid causing a mass panic attack," he posted on Instagram.

He was eventually told to stop, and "since the attacker was still on the run, we hid in a nearby store while police helicopters circled above us," Topic wrote.

Authorities cancelled the remainder of the weekend festival.

Fatal stabbings and shootings are relatively rare in Germany. The government said earlier this month it wanted to toughen rules on knives that can be carried in public by reducing the maximum length allowed.

In June, a 29-year-old policeman was fatally stabbed in Mannheim during an attack on a right-wing demonstration. A stabbing attack on a train in 2021 injured several people.

Solingen, well known for its knife manufacturing industry, is a city of some 165,000 people.

The episode comes ahead of three state elections next month in Thuringia, Saxony and Brandenburg, in which the anti-immigrant far-right Alternative for Germany (AfD) has a chance of winning.

Though the motive and identity of the assailant were not known, a top AfD candidate for one of the state elections, Bjoern Hoecke, seized on Friday's attack, posting on X: "Do you really want to get used to this? Free yourselves and end this insanity of forced multiculturalism."

(Additional reporting by Thilo Schmuelgen, Rene Wagner, Hatem Maher and Ahmed Tolba; Editing by Kirsten Donovan, Hugh Lawson, Frances Kerry, Giles Elgood and Deepa Babington)