Watch: Spanish Police Thwart Knife Assault by Taking Down Attacker With Barrier

Morocco knife attack
Spanish police officers stop a man on the Beni Enzar border crossing between Morocco and the Spanish enclave of Melilla, Spain July 25, 2017 in this still image from a CCTV video. Interior Ministry via Reuters

This is the dramatic moment that Spanish police subdued a knife attacker on the border of the Spanish enclave of Melilla and Morocco on Tuesday.

The footage, released by the Spanish Interior Ministry, shows officers circling the man, before one rushes him from behind, throwing a plastic bollard at his head and knocking him to the ground.

The man, wearing a shorts and a blue shirt, had held a knife and shouted "Allahu Akbar," or God is great in Arabic, just after 7 a.m. local time at the border checkpoint.

Police arrested the man, a 29-year-old Moroccan citizen, and he is in custody for questioning. His motives for drawing a knife on police remain unclear.

"A man entered the border post and once inside, pulled out a large knife and confronted [police] shouting 'Allahu Akbar' (God is Greater), slightly injuring a policeman," Irene Flores, spokeswoman for the Spanish government's office in Melilla, told AFP news agency.

Spain has two enclaves in North Africa, Melilla and Ceuta, the only land borders between the European Union and Africa. Migrants, many from sub-Saharan Africa, regularly attempt to enter the enclaves in a bid to reach Europe.

Authorities did not say if Tuesday's attack was driven by extremism. Spain has not suffered an extremist attack in recent years like Britain, France and Germany. But it has arrested several Moroccan nationals suspected of activity or support for the Islamic State militant group (ISIS).

In April 2016, police arrested a Moroccan national accused of links to the ISIS leadership and for encouraging attacks in Spain and across Europe.

In September of the same year, police detained two Moroccan nationals on suspicion of planning an attack on European soil after traveling to Turkey to meet an ISIS member. In October, police arrested two Moroccan imams at a mosque on the resort island of Ibiza for alleged support of ISIS and the incitement of jihad.

At least 1,200 Moroccans have traveled to join ISIS in its self-proclaimed caliphate in Iraq and Syria, according to a December 2015 report by the U.S.-based Soufan Group.