Donald Trump has condemned the threat of political violence and urged the media to end its “hostility”, hours after authorities intercepted bombs sent to a news network and prominent Democrats who have been the targets of some of his sharpest barbs.

The president’s pleas for harmony came as law enforcement officials scrambled to find the perpetrator of the thwarted bomb attacks against former president Barack Obama, Hillary Clinton, CNN and others.

The message for the media to “set a civil tone” was a dissonant one for the president, who has repeatedly blasted his political opponents as criminals and argued that they will destroy the country if they win control of Congress.

“We want all sides to come together in peace and harmony,” he said at a campaign rally. “Any acts or threats of political violence are an attack on our democracy itself.”

The president highlighted the unusually subdued tone of his remarks.

“By the way, do you see how nice I’m behaving tonight?” he said. “Have you ever seen this?”

The attempted bombings have prompted debate over whether increasingly personal and hard-edged rhetoric has contributed to a potentially dangerous political climate.

Trump critics have blamed him for the tone, but he did not take any responsibility.

Those “engaged in the political arena” must “stop treating political opponents as being morally defective”, he said. He also referenced high-profile incidents in which conservatives have been accosted in restaurants and public spaces by political critics.

Donald Trump at a rally in Wisconsin
Donald Trump at a rally in Wisconsin (Susan Walsh/AP)

He added: “The media also has a responsibly to set a civil tone and to stop the endless hostility and constant negative and often-times false attacks and stories.”

Mr Trump has frequently labelled stories he does not like as “fake news” and many reporters as “enemies of the people”. He has also denounced political enemies in deeply personal terms and even described those who tried to thwart his second Supreme Court nominee as “evil”.

The president spoke to thousands of supporters at a central Wisconsin rally as he looked to boost struggling Republican candidates less than two weeks from midterm elections.

Republicans in the state have been growing increasingly nervous about the prospects of holding on to the governor’s office, held by Scott Walker, let alone state senator Leah Vukmir’s chances of picking up a US Senate seat held by a well-positioned Democratic incumbent.

Mindful of the news, Mr Trump refrained from delivering some of the most pointed riffs of his regular routine, steering clear of two of his favourite targets: Mrs Clinton and California representative Maxine Waters, whose office appears to have been a target of one of the explosive devices.

He also skipped his usual litany of insults against his potential 2020 rivals, including former vice president Joe Biden, who he often jokes he would beat in a fistfight.

But he had harsh words for Democratic senator Tammy Baldwin, branding Ms Vukmir’s rival a “radical far-left opponent” who “wants a socialist takeover of health care”.

“You know I’m trying to say that very nicely,” he told the crowd with a smile. “Normally I’d scream, ‘They want a socialist takeover!’

“I’m trying to be nice.”

Even though he refrained from mentioning Mrs Clinton, his crowd could not resist, bursting into a “Lock her up!” chant during the pre-show warm-up before he arrived.