You mean people don’t like being called ugly? I’m shocked.

CANNES, France — President Obama came, he saw, he insulted.

“Obama insults Sarkozy,” blared the headline on one French website, taking umbrage at Mr. Obama’s wayward remark at the G20 summit here about the physical appearance of French President Nicolas Sarkozy.

Mr. Obama thought he was making a gentle joke about Mr. Sarkozy, host of the summit, when he congratulated Mr. Sarkozy and wife Carla Bruni on the birth of their baby daughter on Oct. 19. Instead, Mr. Obama caused a minor international incident.

“I want to make mention that this is our first meeting since the arrival of the newest Sarkozy, and so I want to congratulate Nicolas and Carla on the birth of Giulia,” Mr. Obama told reporters shortly after his arrival at the G20, with Mr. Sarkozy at his side. “And I informed Nicolas on the way in that I am confident that Giulia inherited her mother’s looks rather than her father’s, which I think is an excellent thing.”

He added, “And so now we share one of the greatest challenges and blessings of life, and that is being fathers to our daughters.”

Mr. Sarkozy, who is said to be very conscious about his looks, did not appear greatly amused by the comment, and some observers who attended the meeting said Mr. Obama’s remark fell flat.