Police in Saudi Arabia arrested and later released a 14-year-old boy who was filmed dancing to the '90s hit song Macarena at an intersection in the Red Sea city of Jeddah, according to local media reports on Wednesday.

The 45-second video, which went viral on social media in the kingdom, shows the boy wearing headphones, sweat shorts, a striped shirt and neon Crocs. He sways his hips and arms to the Los Del Rio song, and appears to be smiling and giggling throughout the dance.

The state-linked Sabq news website quoted Col. Aati bin Attiyah al-Qurashi as saying police arrested the boy on Tuesday and were preparing to refer him to prosecutors for disrupting traffic and improper public behaviour.

He was released later without charge, and given a warning about road safety, after he and his legal guardian were summoned for questioning, according to a statement from the Interior Ministry. 

"They signed a written pledge that the teen will not engage in behaviour that could endanger his life and the life of others again," it said.

"The notification was solely intended to warn the boy about potential consequences for his own safety, as well as to safeguard the overall safety of motorists and pedestrians." 

Western music and dancing are taboo in Saudi Arabia, but such incidents have not necessarily led to lengthy imprisonment or serious punishment.

Traditional dance, however, is permitted.

Saudi King Salman and Donald Trump were filmed taking part in a traditional all-male Saudi sword dance in May when the U.S. president visited the kingdom to boost ties.

A Saudi woman caused a similar stir last month when — flouting the kingdom's conservative laws — she appeared in a short video wearing a miniskirt and crop top. The woman was also arrested and released without charge. 

Saudi Arabia's heir to the throne, 31-year-old Crown Prince Mohammed bin Salman, has pushed for greater openings for entertainment in the kingdom, including allowing a limited number of musical concerts after a more than a 20-year ban.

He has also encouraged young Saudis to become more physically active as part of a wide-reaching reform agenda that includes raising life expectancy in the country.

With files from Reuters and CBC News