The law will levy a 3.0 percent tax on total annual revenues of the largest tech firms.

France on Thursday became the first major economy to impose a tax on digital giants, with parliament passing the legislation in defiance of a probe ordered by President Donald Trump that could trigger reprisal tariffs.

The new law aims at plugging a taxation gap that has seen some internet heavyweights paying next to nothing in countries where they make huge profits.

The legislation -- dubbed the GAFA tax -- an acronym for Google, Apple, Facebook and Amazon -- was passed by a simple show of hands in the Senate upper house after previously being passed by the National Assembly lower chamber.

But the French move drew an angry response from Trump even before the legislation was passed, with the president ordering an investigation that the French economy minister said was unprecedented in the history of French-US relations.

The law will levy a 3.0 percent tax on total annual revenues of the largest tech firms providing services to French consumers.

"The United States is very concerned that the digital services tax which is expected to pass the French Senate tomorrow unfairly targets American companies," US Trade Representative Robert Lighthizer said in a statement.

But French Economy Minister Bruno Le Maire France rejected the US reaction on Thursday, saying "threats" were not the way to resolve such disputes.

"Between allies, I believe we can and must resolve our differences in another way than through threats," he told the French Senate ahead of the vote.

"France is a sovereign state and it alone decides on its taxation mechanisms and it will continue to do so," he said.

Unfair trade practices?

Le Maire said he was warned about the so-called Section 301 investigation during a "long conversation" with US Treasury Secretary Steven Mnuchin on Wednesday, saying it was the first time such a step had been taken in the history of French-US relations.

This type of investigation is the primary tool the Trump administration has used in the trade war with China to justify tariffs against what the United States says are unfair trade practices.

The measure was initially adopted by the lower house on July 4.

Last month, top G20 finance chiefs meeting in Japan agreed there was an urgent need to find a global system to tax internet giants like Google and Facebook but clashed over how to do it.

But they welcomed a set of proposed measures laid out by the Organization for Economic Co-operation and Development (OECD), a forum for advanced economies.

"We will redouble our efforts for a consensus-based solution with a final report by 2020," they said in a statement.

Washington has been pushing through the G20 for an overarching agreement on taxation.

Such a move is supported by Google which believes it would mean Silicon Valley tech giants would pay less tax in the US and more in other jurisdictions, in a departure from the longstanding practice of paying most taxes in a company's home country.

The section 301 investigation, which is being run by the US Trade Representative's office, has said it will hold hearings to allow for public comment on the French tax issue for several weeks before issuing a final report.

The move was applauded by the Computer & Communications Industry Association which said the French law would retroactively require US internet giants to turn over a percentage of their revenues from the start of 2019.

"This is a critical step toward preventing protectionist taxes on global trade," CCIA official Matt Schruers said in a statement, calling on France "to lead the effort toward more ambitious global tax reform, instead of the discriminatory national tax measures that harm global trade."