Madrid (AFP) - As Spain readies to celebrate Epiphany Thursday with hugely-popular parades, authorities have implemented unprecedented security measures such as banning trucks from Madrid and Barcelona to avoid attacks like those in Berlin and Nice.

A truck ban and special police forces will be present in "strategic areas" in Madrid and Barcelona during Epiphany celebrations. © AFP/File Curto De La Torre Madrid (AFP) — As Spain readies to celebrate Epiphany Thursday with hugely-popular parades, authorities have implemented unprecedented security measures such as banning trucks from Madrid and Barcelona to avoid attacks like those in Berlin and Nice.

Hundreds of thousands of people attend the traditional parades each year on the eve of the feast of the Epiphany on January 6, which celebrates the coming of three wise men to bring gifts to Jesus.

Just as with Santa Claus, children write letters to the Magi asking for gifts which are left for them on January 6, a national holiday in Spain, and the celebration is more popular than Christmas.

Security is always tight, but this year, authorities in Madrid and Barcelona have taken the unprecedented step of banning trucks with a payload capacity of over 3.5 tonnes bar exceptions like public service vehicles, both city halls announced.

In the Spanish capital, the ban has been in place since Tuesday in some parts of the city where auxiliary parades to the main one on Thursday evening have already been taking place.

Horse riders wave to the crowd during the traditional Epiphany parade in Malaga, southern Spain, January 5, 2015. Traditionally, children in Spain receive their presents delivered by the Three Wise Men on the morning of January 6 during the Christian holiday of the Epiphany. REUTERS/Jon Nazca

The roads leading to the big avenue where the main parade will happen will also be filled with obstacles such as police cars and moveable fences.

The measure seeks to guard against truck attacks like those that hit Nice and Berlin.

Spain's interior ministry said in a statement there would be an "increase in the presence of uniformed patrols on foot and in vehicles."

Special police forces would also be present in "strategic areas," it added, without saying exactly how many agents would be deployed nationwide.

A tow truck operates at the scene where a truck ploughed through a crowd at a Christmas market on Breitscheidplatz square in western Berlin, Germany, December 20, 2016. Reuters/Fabrizio Bensch

The measures mirror those taken on New Year's Eve around Madrid's Puerta del Sol square, where thousands gather to eat grapes on each count of midnight.

Last week, police were given a shock when they arrested two alleged jihadists and found videos at the home of one of the suspects showing armed men in front of an image of the square.

Spain has been mentioned on extremist websites as a possible attack target for historical reasons, given Muslims ruled in the country for close to eight centuries until 1492.

It increased its terror alert to category four on a five-point scale in 2015, but authorities were quick to ally fears last week, saying there is no indication an attack was in the works.