The men were discovered at a service station near the Basque town of Hernani when the driver of a vehicle parked up alongside heard banging and shouts coming from within the truck.
The truck, which had originated in Poland but last stopped for reloading in Belgium on Monday night, was carrying fruit and was bound for the MercaMadrid wholesale food market in Spain's capital.
The three men, who are in their thirties and are thought to be Syrian nationals, were hospitalized with signs of hypothermia, but are said to be recovering well.
The Ertzaintza, the Basque regional police force, have opened an investigation to determine whether the driver was aware of his human cargo hidden within a compartment where the temperature was just 10C.
Spain has agreed to accept 14,900 people under an EU agreement to relocate refugees from hotspots in Greece, Italy and Hungary, the first of whom will arrive in early October.
Citizens had lobbied the Spanish government to do more to solve the refugee crisis after Spain initially rejected the EU compulsory quota.
More than a hundred local councils across Spain have declared themselves "refugee friendly" and thousands of people have signed up to offer them homes.
The banner hanging on Madrid City Hall. Photo: AFP
The Syrian refugee family whose plight was made famous when they were tripped by a camerawoman while fleeing police at the Hungarian border have found a home in Madrid.