The new law is part of the 2014 budget and is a watered-down version of a bill that would have imposed sales tax on all e-commerce activities in Italy and now applies only to the sale of advertising space.
The measure - dubbed "Google tax" or "web tax" by the Italian press - comes into force on January 1st.
The measure is believed the first of its kind in Europe and could boost the tax bill for tech giants who currently sell advertising through intermediaries based in states with lower taxes like Ireland of Luxembourg.
"They will have to pay taxes in Italy on the advertising they sell in Italy," said the measure's chief proponent, Francesco Boccia, a lawmaker from the main centre-left Democratic Party.
"An Italian hotelier who buys online advertising will pay the same but the payment will go through a company that pays sales tax in Italy," he said.
He said the increased tax revenue could bring in between €100 million and €150 million a year but the main benefit is that it would help keep track of what he said was a "financial haemorrhage" for the country.
"We suffer this without batting an eyelid," he said.
The European Commission has spoken of "serious doubts" about the measure, which could contravene rules on the single market and non-discrimination in Europe.
Prime Minister Enrico Letta said the new measure needs "co-ordination with European norms" but that it is important in making the issue a "priority" for Europe.
Critics from Italy's tech world have been vehement in their hostility.
Carlo Alberto Carnevale-Maffe, a lecturer in digital economy at Bocconi University in Milan, said Italian companies that want to buy advertising space online would be particularly adversely affected.
"What are they thinking in parliament?" he said, complaining that there had been no in-depth analysis of its impact or public consultation before approval.
"It fences in businesses in a digital enclosure. You cannot make the Internet territorial," he said.
"The ridiculous aspect is that it hurts small companies trying to export," he said, estimating that it would raise "at best dozens of millions of euros a year but will cost billions in terms of lost exports".
Wired magazine's Italian edition has also been highly critical, saying the measure will "damage" Italy.
"Italy's entire digital economy is affected," it said.