Thunberg, who had taken the train from Lisbon ten hours earlier, was escorted out of the station by Spanish police as reporters and fans gathered around her.
The impassioned teen activist had refused to take a plane from the Portuguese capital as part of her reluctance to contribute to high carbon emission transport, a policy which also saw her take a three-week journey across the Atlantic by catamaran to reach Madrid from South America.
It remains unclear whether she will be attending the COP25 UN climate summit currently taking place in the Spanish capital, but she has confirmed her participation at a five-kilometre climate march in Madrid called “The world has woken up to the climate emergency”, which tens of thousands of activists are expected to join.
Thunberg, 16, has become the face of young peoples' demands for climate action and made a point of making the journey back from September's New York climate summit by sea rather than fuel-guzzling plane.
She had expected to be heading for Chile, but the South American nation passed the hosting of the COP25 summit meeting to Spain after suffering a spate of violent anti-government protests.