President Trump on Tuesday congratulated China on the 70th anniversary of Communist Party rule, a message posted hours after a protester in Hong Kong was shot by authorities in an escalation of force aimed at tamping down mass pro-democracy demonstrations.

Trump’s cheerful commemoration in a one-sentence tweet to “President Xi and the Chinese people” stood in sharp contrast to the condemnation aimed at Chinese leadership from fellow Republicans, and it drew denunciations from human rights groups.

China’s National Day “marks 70 years of grim testimony to the Chinese Communist Party’s brutality against the Chinese people,” Sen. Marco Rubio (R-Fla.) said. “Democracies should press the Chinese government to respect the God-given rights of its people and uphold the rule of law.”

Trump’s message, which some critics read as a tacit endorsement of Xi’s authoritarian rule, came as the Chinese leader staged an elaborate military parade and fireworks celebration in Tiananmen Square. It was a display of nationalist propaganda aimed at demonstrating the rising Asian power’s strength and influence amid a trade war with the United States. Analysts have called Xi China’s most powerful figure since Mao Zedong.

The sustained protests in Hong Kong — an economic hub that has operated under a “one-country, two-systems” political rule distinct from the Chinese mainland since the late 1990s — have tested Beijing’s willingness to tolerate political expression at a time when Xi has pursued a broad and sustained crackdown on free speech and political dissent.

Yet the demonstrations have drawn little public support from Trump, who has generally refrained from criticizing Beijing on human rights issues as he seeks to negotiate a bilateral trade deal.

“Odd way to mark the day the world’s deadliest regime was established,” Marion Smith, executive director of the Victims of Communism Memorial Foundation, said in response to Trump’s tweet. “The Chinese Communist Party has been killing and expanding its power ever since. Today its iron grip is strangling the people of Hong Kong.”

Trump’s allies defended him Tuesday by emphasizing that the administration has adopted hard-line policies on Beijing on trade and defense after elevating China to a strategic competitor in the U.S. National Security Strategy.

At a Chinese Embassy reception last year to mark its National Day, Matt Pottinger, then the top Asia policy official in the National Security Council, offered a blunt message to his hosts. The Trump administration sought “to bring the concept of competition to the forefront,” said Pottinger, who was promoted this month to become Trump’s deputy national security adviser.

Associates noted that Trump also has made plenty of critical statements aimed at China. One former official pointed to a tweet from the president late Monday in which Trump stated that the United States is “winning” the trade war and military competition.

“Happy Birthday China!” Trump added in that tweet, which the former official described as a sarcastic note.

Michael Pillsbury, a China analyst at the conservative Hudson Institute who has informally advised Trump on trade, said the president’s tweet was consistent with his broader strategy to stand up to Beijing on strategic issues while maintaining a decent personal relationship with Xi.

Trump has followed a similar playbook with North Korean dictator Kim Jong Un, enacting tough economic sanctions on Pyongyang over its nuclear weapons program while making warm public statements about Kim, whose regime is among the world’s most brutal.

Trump “does not want to start a Cold War with China or seek to overthrow the Chinese Communist Party,” Pillsbury said. The message of congratulations “doesn’t mean the president is done making statements about China. One tweet does not a summer make.”

During the Obama administration, the State Department offered annual statements of congratulations to China, as well as many other nations, on their national days.

In September 2015, for example, then-Secretary of State John F. Kerry offered good wishes to the country on behalf of President Barack Obama, highlighting the “warm friendship” of the two countries. Kerry noted Xi’s state visit to Washington a week earlier, which showed “how much we can accomplish through cooperation.”

A former Obama administration official said Trump’s tweet was different, however, because he does not regularly congratulate other nations on their national celebrations and doing so demonstrated his “misplaced priorities” in trying to ingratiate himself with Xi.

Diplomatic relations between Washington and Beijing have deteriorated during Trump’s tenure as initial efforts at bonhomie have given way to an escalating tariff war. Some in the Trump administration reportedly weighed imposing limits on U.S. investments in Chinese companies and financial markets, according to Bloomberg News, though Trump officials have played down the reports.

Trump has grown increasingly frustrated at the lack of progress on trade talks. In late August, the president appeared to cast Xi as an “enemy,” though he has since returned to praising his leadership.

In a speech last week at the United Nations, Trump offered his strongest show of support for the Hong Kong protesters, stating that the “world fully expects that the Chinese government will honor its binding treaty . . . in which China commits to protect Hong Kong’s freedom, legal system and way of life. How China chooses to handle the situation will say a great deal about its role in the world in the future. We are all counting on President Xi as a great leader.”

But Xi has remained defiant. In his address at the 70th National Day celebration, he declared: “No force can stop the Chinese people and the Chinese nation.”

Gordon Chang, an author and Fox News commentator who promotes a hawkish view on China, called Trump’s tweet of congratulations “strategically unsound.”

Chang praised Trump’s tougher trade policies on China, but he added: “There are people around the world who look to the president of the United States as a beacon of freedom, democracy and liberty.”