PARIS — President Emmanuel Macron’s government waded into a potentially messy fight with the White House on Thursday as French lawmakers voted to impose a tax on Facebook, Google and other American technology giants despite a blunt warning from the Trump administration.

The measure, which the White House said could amount to an unfair trade practice, is likely to be signed into law by Mr. Macron within two weeks, placing France squarely in the cross hairs of President Trump’s escalating trade wars.

The finance minister, Bruno Le Maire, told the French Senate before the vote that Steven Mnuchin, the United States Treasury secretary, and Robert Lighthizer, the White House’s top trade negotiator, phoned him on Wednesday to say the United States is opening an investigation into the French tax using a mechanism Mr. Trump had already employed to impose sweeping tariffs on China.

It was the first time in the history of French-American relations that the United States had taken such a step, Mr. Le Maire said. “I believe that between allies we can and must sort out differences in other ways than by using threats,” he said.