UNITED NATIONS — President Trump on Wednesday accused a foreign power of meddling in an American election: not Russia, but China.

The Chinese, Mr. Trump claimed, are trying to damage his political standing before the midterm elections because of his imposition of tariffs on billions of dollars in Chinese goods. Speaking at the United Nations Security Council, where China’s foreign minister was also present, he said, “They do not want me or us to win because I am the first president to ever challenge China on trade.”

It was not the first time the president has accused the Chinese of meddling in the nation’s affairs: He has complained that in response to his tariffs, it had imposed retaliatory ones aimed at American farmers and other politically sensitive constituencies in states that support him. But he has never leveled the accusation so bluntly or in such a high-profile international setting.

Mr. Trump did not suggest that China’s behavior was on the scale of Russia’s sophisticated campaign of manipulating social media and the release of hacked emails during the 2016 presidential election.