A woman carrying a grenade-shaped belt buckle on a train from Barcelona to Madrid caused a security lockdown and forced a station to be partly evacuated as well as railway delays.

Police in Barcelona said they were advised by security personnel in the city's main Sants station that "they had seen by scan an object that could be an explosive artefact," a spokesman said.

Most Spanish stations require passengers boarding trains to put their luggage through scanners.

A photo of the luggage scan posted on the Twitter feed of Catalonia's Mossos police force showed what looked clearly like a grenade.

Police subsequently evacuated two high-speed trains at the Barcelona station but did not find anything, the spokesman said.

"Then we saw that this person could be in a train going to Madrid. We warned national police," he added .

In the Spanish capital, police said they created a security zone on part of a platform at Atocha station, which was the scene of one of Europe's worst terror attacks in 2004 when 191 people were killed in explosions on commuter trains.

When the train arrived, they checked the luggage and found that the grenade-like object was actually a "belt buckle," a police spokeswoman said.

It is unclear why security personnel in Barcelona let the passenger get onto the train if they were worried about the potential grenade.

Adif, Spain's state company that manages stations and rail infrastructure, said they were looking into the incident.