His arrest on Tuesday came just moments after a Vienna appeals court ruled he could be extradited to the United States on bribery charges following a three-year trial.
Spanish and US authorities had filed separate requests for Firtash's detention, saying he was at risk of flight.
But the court in Vienna said it found no reason to keep him custody because he had already handed in his passport and paid bail of €125 million ($130 million) when he was first detained in 2014.
Firtash, 51, was to be released on Friday. The decision can be appealed within 14 days.
The tycoon, who denies all charges, has been under house arrest in Austria over the past three years.
An ex-ally of Ukraine's ousted pro-Russian president Viktor Yanukovych, Firtash made money through connections with Russian gas giant Gazprom, and was at one time linked to a former campaign aide of US President Donald Trump.
Firtash is wanted in the US over charges that he and five others paid $18.5 million in bribes to officials in India to secure titanium mining licences in 2006.
The United States argues it has jurisdiction because the conspiracy involved using US financial institutions, travel to and from the US, and use of US-based communications -- computers, telephones, and the internet.
Firtash, however, insists he is the victim of a smear campaign. His legal team argued that he was caught up in a larger battle over the future of Ukraine, where the government has been engaged in bloody fighting with Russian-backed separatists in the east since 2014.
In April 2015, a lower court sided with the oligarch and ruled against extraditing him to the US, saying the request was "politically motivated".
But the appeals court said on Tuesday that the US had provided "sufficient" proof that Firtash "may have committed the crimes he is accused of".
Austria's Justice Minister Wolfgang Brandstetter told broadcaster ORF the extradition would not be implemented until a court had reviewed the Spanish case.
Firtash owns Group DF, a business empire involved in energy, chemicals, media, banking and property in Ukraine and other countries including Germany, Italy and Austria.