The Greek captain was accused of not co-operating with maritime authorities after he raised the alert on Wednesday and was held on suspicion of "disregard both for sea resources and the environment".
The oil-tanker Prestige has leaked 1,500 tonnes of oil and a gaping hole is widening, raising fears that the ship could spill the rest of its 77,000 tonne cargo into the sea.
But officials believe the picturesque Spanish coastline will be spared from harm.
Spill contained
The tanker had set off from Latvia and encountered violent storms about 48 kilometres (30 miles) off the province of Galicia in north western Spain.
The tanker ran into trouble off the Cape Finisterre, which has been described as the cemetery of countless men and ships.
There is some confusion about whether the ship was due to dock in Gibraltar or not.
An expert from the international organisation Oil Spill Response Ltd, who worked on the Exxon Valdez spill, has joined the Spanish Coast Guard Agency.
Inshore booms and pumping equipment have been deployed to try to contain the oil.
The ship is to be towed out to see where it will be taken over by a Dutch salvage company.
Bird concern
Conservation groups have warned, however, that the tanker, which is being escorted away from Spanish waters, is putting some of the country's most vulnerable birdlife at risk.
Of particular concern to conservationists are the many species of migratory birds that use the area as a resting stop before continuing south.
The Spanish Ornithological Society is closely monitoring the situation and is organising a network of volunteers to monitor any impacts of the oil spill on seabirds.