Five men have been arrested in Germany suspected of being involved in a plot to drive a vehicle into people at a Christmas market.

Three Moroccans, an Egyptian, and a Syrian were detained on Friday over the plan to target a market in the southern Bavarian state. Authorities said they suspected an Islamist motive.

Prosecutors stated that the 56-year-old Egyptian allegedly called for a vehicle attack aimed at killing or injuring as many people as possible, while the Moroccans were said to have agreed to carry out the attack.

German officials have been on high alert due to previous attacks at Christmas markets, including a December incident in Magdeburg that killed six people.

While authorities did not specify when the planned attack was to occur or the exact market targeted, it is believed to be in the Dingolfing-Landau area, northeast of Munich.

Reports indicate that the Egyptian suspect was an imam at a local mosque. The Moroccan men, aged 30, 28, and 22, are accused of conspiracy to commit murder, while the 37-year-old Syrian allegedly encouraged their actions.

Following their appearance before a magistrate on Saturday, all five suspects remain in custody.

Joachim Herrmann, Bavaria's state interior minister, credited the excellent cooperation between security services for preventing a potentially deadly attack.

Christmas markets, known for attracting large crowds and tourism, have seen increased security measures in recent years following a tragic 2016 attack in Berlin where twelve people died.