A man has been arrested on the border between Morocco and Melilla, a Spanish outpost on the north coast of Africa, after attacking police with a knife.

The man shouted "Allahu akbar" as he approached the border crossing this morning (25 July) but was eventually flattened by a police officer putting a plastic traffic barrier to innovative use.

The man, who approached the border from Beni Enzar on the Moroccan side is believed to be a Moroccan national himself, according to Reuters. He is in his 20s, according to Euroweekly.

CCTV footage of the incident shows police backing away from the man as he brandishes a knife threateningly and makes his way into the Spanish territory.

Officers, armed only with batons, give him plenty of room as he slowly passes unhindered over the tarmac.

Eventually, the assailant is approached by an officer with a shield. This causes him to hesitate, providing another officer with an opportunity to throw a large traffic barrier at the back of his head.

It is an effective ploy. He goes down hard and several police officers restrain him.

One officer is understood to have suffered minor hand injuries in the struggle. The man is now being questioned by police.

The clip was uploaded to Twitter by Spanish Interior Minister Juan Ignacio Zoido. He said: "The rapid, coordinated and professional conduct of the police has avoided a serious incident in Beni Enzar. All my support to the hurt officer."

Melilla is a popular destination for refugees and people attempting to enter the European Union. In 2014, at least 1,000 migrants tried to storm the 6m-tall border fence. Around 500 sub-Saharan Africans were reported to have successfully crossed into the Spanish autonomous city.