Police have foiled an ISIS-inspired knife attack on Sunday's half-marathon in Berlin.

Special police forces detained six men in connection with the sporting event that was attended by 36,000.

German daily Die Welt said the main suspect was planning to kill participants and spectators with knives.

According to Die Welt, the main suspect knew Anis Amri, the Tunisian attacker who targeted a Christmas market in 2016.

Amri killed 12 people when he hijacked a lorry and drove it into the crowded market in Berlin on December 19, 2016.

Scroll down for video

Police have foiled a knife attack on Sunday's half-marathon in Berlin and arrested four men

The paper reported that the suspect, who was not identified, had prepared extra-sharpened knives to use in the attack.

The suspect had in his possession two knives which had been especially sharpened for this purpose, the report said.

A source close to the investigation, however, told AFP that the Welt report that a knife attack was being planned 'went too far'.

Amri's attack in Berlin in 2016 had prompted German lawmakers to call for tougher security measures.

Prosecutors and police said in a statement they had received 'isolated indications that those arrested (Sunday) between the ages of 18 and 21 may have been involved in planning a violent crime in connection with this event'.

The security authorities said that on that basis and after a deadly van rampage on Saturday in the western German city of Muenster, they decided to swoop on the suspects.

'Due to the still ongoing investigation, no further information can be provided at this time,' they said.

The statement spoke only of 'several' arrests but a tweet by the police mentioned six arrests carried out by special forces.

A police spokesman told AFP later that they had confiscated 'data storage devices, mobile phones, two vehicles and a small knife' during the raids.

He confirmed that the suspects arrested 'might have planned something during the half marathon' but 'we don't know what exactly'.

The daily Tagesspiegel reported earlier that a 'foreign intelligence service' had warned Berlin police of the possibility of an attack on the half marathon.

And it confirmed suspicion of a link between one of the suspects and Amri.

Police declined to comment on the media reports.

No major Islamist militant attack has been carried out in Germany since.

Last month, Italian police arrested five people connected to 24-year-old Amri.

Police said one of the five was believed to have procured the fake Italian identity papers that allowed Amri, a failed asylum-seeker, to move around Europe.

Secial police forces detained four men in connection with Sunday's sports event in Berlin

The suspect, who was not identified, had prepared extra-sharpened knives to use in the attack

Earlier on Sunday, Interior Minister Horst Seehofer said the government would do everything possible to protect citizens.

He added: 'We have again experienced that ... absolute security is unfortunately not possible.'

Seehofer was speaking in Munster, where a man drove a camper van into a group of people sitting outside a restaurant on Saturday, killing two of them before shooting himself dead.

The main suspect knew Anis Amri (pictured), the Tunisian attacker who targeted a Christmas market in 2016

Authorities have said the attacker was a 48-year-old German citizen with mental health problems and that there was no indication of an Islamist militant connection.

A top German security official said there was no indication of an Islamist motive but officials were investigating all possibilities.

Witnesses said people ran away screaming from the city square after the crash at 3.27pm on Saturday.

Local media reports claim the 48-year-old man - named locally as Jens R. - had been in contact with far-right groups.He was a Munster resident and apparently well-of.f

He was well-known to police and had a history of run-ins with the law, German prosecutors said, adding that they believe he acted alone.

The city's police president, Hajo Kuhlisch, said the man's four apartments - two in Munster and two in Saxony - and several cars had been searched thoroughly, but officers were still investigating the evidence and it was too early to speculate about a motive.

A man brings flowers to the scene in Munster where a van driver crashed into people drinking outside a popular bar, killing two people and injuring 20 others before killing himself

Police quickly set up a large cordoned-off area for their investigation and ambulances rushed to the site.

Herbert Reul, the interior minister of North Rhine-Westphalia state, where Munster is located, said the driver of the grey van was a German citizen.

He stressed that the investigation was at an early stage but said 'at the moment, nothing speaks for there being any Islamist background'.

Bild reports that detectives are looking into whether the attack was a case of 'extended suicide' similar to the case of Andreas Lubitz, who deliberately crashed a Germanwings flight in 2015, killing all 144 passengers and crew on board. The man had recently attempted suicide, ZDF reports.

The local daily Muenstersche Zeitung reported that the perpetrator had vaguely announced his suicide plans a week ago in an email to friends and that he was known to the authorities for previous violence and drug violations, but police wouldn't confirm any of those details.