MOSCOW—President Vladimir Putin said Russia wouldn’t expel U.S. diplomats in response to new U.S. sanctions despite the recommendation of his foreign minister, a move that seemed aimed at embarrassing the Obama Administration while expressing hope for stronger U.S. relations once President-elect Donald Trump takes office.

Mr. Putin’s decision came after Russia’s top diplomat, Sergei Lavrov, said in a nationally televised address that Russia must respond to the U.S. moves, which included kicking out 35 Russians it alleged were intelligence operatives serving under diplomatic cover. Instead Mr. Putin chose not to act, and invited the children of U.S. envoys to a New Year’s celebration held at a concert hall on the grounds of the Kremlin.

The Russian leader’s move appeared choreographed to highlight an attempt at rebuilding ties with the U.S. that have been at their worst since the end of the Cold War, strained by allegations of Russian hacking and aggression in Ukraine. But Mr. Putin reserved the right to respond in the future.

Mr. Trump praised Mr. Putin for his restraint in a Twitter message posted Friday. “Great move on delay (by V. Putin),” Mr. Trump wrote. “I always knew he was very smart!”