WASHINGTON — Facing withering attacks accusing him of seeking foreign assistance for President Trump’s re-election campaign, Rudolph W. Giuliani announced on Friday night that he had canceled a trip to Kiev in which he planned to push the incoming Ukrainian government to press ahead with investigations that he hoped would benefit Mr. Trump.

Mr. Giuliani, President Trump’s personal lawyer, explained that he felt as if he was being “set up” by Ukrainians critical of his efforts, and he blamed Democrats for trying to “spin” the trip.

“They say I was meddling in the election — ridiculous — but that’s their spin,” he said.

Mr. Giuliani said on Thursday that he had hoped to meet in Kiev, the Ukrainian capital, with the nation’s president-elect and urge him to pursue inquiries that could yield new information about two matters of intense interest to Mr. Trump. One is the origin of the special counsel’s investigation into Russia’s interference in the 2016 election. The other is the involvement of former Vice President Joseph R. Biden Jr.’s son in a gas company owned by a Ukrainian oligarch.

The trip raised the specter of a lawyer for Mr. Trump pressing a foreign government to pursue investigations that his allies hope could help him win re-election. And it comes after Mr. Trump has spent more than half of his term facing scrutiny about whether his 2016 campaign conspired with Ukraine’s hostile neighbor, Russia. Mr. Giuliani had planned to leave on Sunday.