President Trump on Wednesday directly accused China of interfering in the U.S. midterm elections this fall in retaliation for the ongoing trade war between Washington and Beijing, marking a new front in the deepening hostilities that have threatened to upend bilateral relations.

The president made the allegation during his opening remarks at a U.N. Security Council meeting on nonproliferation, asserting that China “has been attempting to interfere in our upcoming 2018 election, coming up in November, against my administration. They do not want me or us to win because I am the first president to ever challenge ­China on trade, and we are winning on trade — we are winning on every level. We don’t want them to meddle or interfere in our upcoming election.”

Trump presented no evidence for his claims, and his top national security advisers told reporters in August they had not found specific examples of interference ahead of the midterms from countries other than Russia, though they warned it remained a possibility. In his remarks at the Security Council meeting, Trump made no mention of Russian interference, though he did say later that his administration also will not let Moscow interfere in the elections.

Afterward, in a hastily arranged media call intended to explain the president’s remarks, a senior administration official said China has hurt “farmers and workers in states and districts that voted for the president because he stood up to the ways China has taken advantage of our country economically.” The official added that the activities include “targeting certain districts and states with tariffs, but go beyond that.” He did not elaborate.

Later Wednesday, while fielding questions from the media at a news conference, Trump insisted: “We have evidence. It will come out. I can’t tell you now. But it didn’t come out of nowhere. That I will tell you. They’ve actually admitted that they’ve gone after farmers.”

Trump’s allegation comes weeks before the midterm elections in which polls suggest his Republican Party could suffer significant losses.

Chinese officials denied the allegation.

“China has all along followed the principle of noninterference in other country’s domestic affairs,” Chinese Foreign Minister Wang Yi said at the U.N. meetings. “We did not and will not interfere in any countries’ domestic affairs. We refuse to accept any unwarranted accusations against China.”

Republicans are facing a difficult midterm election cycle, and Trump has been holding campaign rallies in key states in support of GOP candidates. The president’s frustration with ­China also could be aimed at blaming outside forces if the party is unable to maintain control of Congress.

The Chinese state media purchased a four-page advertising supplement in the Des Moines Register in Iowa this week touting China as “an example for the world” and even noting that President Xi Jinping had studied in the state when he was a college exchange student. Trump tweeted about the ad on Wednesday, after his speech.

China, Russia and other countries have been purchasing such advertisements for many years in many newspapers, including The Washington Post.

In a photo op with Japanese Prime Minister Shinzo Abe, Trump referred to the advertising supplements and said Beijing was aiming to punish U.S. farmers through high tariffs.

“China is going and attacking the Farm Belt, our farmers,” Trump said. “They’re attacking our industrial — with ads and with statements that do not look like ads, they look like editorial, but they’re not. They’re made up by China.”

The president added that Chinese markets are down and U.S. markets are up, implying that the United States is winning the trade war.

“China is getting hurt,” Trump said. “I don’t like it when they attack our farmers and I don’t like it when they put out false statements. Besides that, we find out they’re trying to meddle in our elections, and we’re not going to let that happen — just like we’re not going to let that happen with Russia.”

Trump’s remarks appear consistent with a White House strategy, devised in the immediate aftermath of his Helsinki summit with Russian President Vladimir Putin, to spread blame for election interference beyond Russia. At the July summit, Trump appeared to give more credence to Putin’s denials of 2016 election interference than to U.S. spy agencies’ assessment to the contrary.

In August, national security adviser John Bolton said the president was working to bolster the resilience of election systems and processes “to confront Russian and other foreign malign influence in the United States.”

U.S. intelligence agencies have long tracked Chinese efforts to spy on the United States both through cyber and traditional human means. The Chinese have for years tried to cultivate contacts in U.S. universities, think tanks, businesses and government agencies to gather information on policies, technology and more.

Trump’s accusation is likely to reverberate in Beijing, where Chinese leaders have become increasingly convinced that the Trump administration is pursuing a strategy aimed at containing the country’s economic growth. Hard-liners in the ruling Communist Party have been eager to highlight the increasingly harsh rhetoric from Trump and his aides as evidence that the United States is seeking to punish China.

The two sides have engaged in a fast-escalating trade war, ­having both implemented tariffs on more than $250 billion worth of goods. Trump has boasted that the U.S. economy is performing at record levels while China’s is struggling as evidence that the United States is winning the dispute.

But economists have warned that the tariff battle could do damage to both sides over the long term if a deal is not reached.

During a speech to the U.N. General Assembly on Tuesday, Trump said he maintained “great respect and affection for my friend, President Xi,” but added that “our trade imbalance is just not acceptable. China’s market distortions and the way they deal cannot be tolerated.”

Trump continued to call Xi his “good friend” during his news conference, but when pressed by a reporter, the president acknowledged that the growing tensions have taken a toll. ­“Maybe we’re not anymore,” he said.

On Tuesday, in remarks at The Citadel, a military college in South Carolina, Director of National Intelligence Daniel Coats said the Chinese government is “targeting U.S., state and local governments and officials” and “trying to exploit any divisions between federal and local levels on policy.”

He did not specify which states, officials or policy divisions China was trying to exploit.

In 2008, the Chinese government hacked the campaigns of presidential candidates Barack Obama and John McCain. The cyber intrusions were seen by U.S. officials as classic intelligence-gathering operations to glean insights into the China policies of the potential next president.

The Chinese did not, however, release any of the position papers or emails they’d obtained into the public — or appear to use the information in any way other than for intelligence purposes. By contrast, the Russian government in 2016 hacked the Democratic Party’s system, as well as the personal email accounts of Hillary Clinton’s advisers, and strategically released the information through the online platform WikiLeaks to disrupt the Democrats’ national convention and exploit divisions within the party — a move that threw the campaign into chaos and hurt Clinton’s electoral chances.

Nakashima reported from Washington. Philip Rucker, Shane Harris and Gerry Shih in Washington contributed to this report.