As in neighbouring France, the levy will place a 3.0 percent tax on earnings from online ads, deals brokered on digital platforms and sales of user data by tech companies with at least 750 million euros ($812 million) in global revenue such as Facebook and Google.
But Budget Minister Maria Jesus Montero said the tax would not be implemented until December 2020 to give time for the Organisation for Economic Cooperation and Development (OECD) to reach an agreement on a separate, global tech tax.
Washington initially threatened to impose sky-high retaliatory duties on $2.4 billion of French products from wines to leather handbags after Paris introduced its digital tax last year.
But both sides agreed last month to pursue a global framework under the aegis of the OECD and Paris suspended collecting the revenue until the end of 2020.
“Spain can't afford to have a tax system rooted in the last century. We must move towards a tax system for the 21st century, which takes into account this new form of activity,” Montero told a news conference after Socialist Prime Minister Pedro Sanchez's cabinet approved the digital tax.
The goal of the levy is to “avoid unfair competition with traditional businesses,” she added.
Officials around the world are grappling with ways to tax tech companies, who often report profits in low-tax jurisdictions like Ireland or Luxembourg, enraging other governments.
Montero said the criteria to apply the digital tax “did not discriminate in terms of nationality or type of business”.
Britain has also vowed to press ahead with its own digital tax despite the potential impact on its hopes of forging a trade deal with the United States as it exits the European Union.
Spain expects to raise 968 million euros a year in extra tax revenue with this new levy, and 850 million euros a year through a new tax on financial transactions it also approved on Tuesday.
Sanchez's cabinet in January 2019 approved the creation of the two taxes but the bills died before being getting a chance to be discussed in parliament because he was forced to call snap elections after failing to pass a budget.