VERSAILLES, France — France’s newly elected president, Emmanuel Macron, came out of his first meeting with President Vladimir V. Putin of Russia on Monday with a message of stark challenge, promising French military reprisals for any use of chemical weapons by Russia’s allies in Syria and saying he would closely monitor the curtailing of civil rights for gay people in Chechnya.

Against the gilded backdrop of the Palace of Versailles, Mr. Macron and Mr. Putin pledged to work with each other to fight terrorism. But their body language was at times tense, and the sometimes confrontational tone of the meeting was made clear in Mr. Macron’s comments afterward during a joint news conference, where he signaled his intent to play a forceful role on the global stage and not be cowed by other world leaders.

With Mr. Putin standing beside him, he accused two news organizations with ties to Russia of acting as “organs of influence” rather than as true outlets for journalism. And he publicly warned the Russian leader that the use of chemical weapons was a “red line” for France. “The use of chemical weapons by anyone will be the object of reprisals and immediate retaliation on the part of France,” he said.

Mr. Putin has strongly backed President Bashar al-Assad of Syria, whose forces have been accused of using chemical weapons as recently as April. The Russian president did not respond directly to Mr. Macron’s implicit challenge.