BUENOS AIRES — President Trump on Thursday abruptly canceled his planned meeting with President Vladimir V. Putin of Russia, citing the unresolved naval standoff between Russia and Ukraine and upending his hopes of further cementing the relationship between the two leaders.

The president’s decision, announced on Twitter barely an hour after he told reporters he still expected to go through with the meeting, came shortly after new revelations that Mr. Trump’s personal lawyer had negotiated to build a tower in Moscow much later during the 2016 presidential election than previously acknowledged.

The last-minute cancellation underscored just how fraught the Russian-American relationship has grown despite the president’s concerted efforts to make friends, as the Kremlin increasingly asserts itself overseas while Washington is absorbed by the investigation into ties between Mr. Trump’s circle and Moscow.

When Mr. Trump met with Mr. Putin in Helsinki last summer, it came just days after the special counsel, Robert S. Mueller III, had indicted 12 Russian intelligence officers in the hacking of Democratic emails during the 2016 campaign. Undaunted, Mr. Trump went ahead with that meeting and, with Mr. Putin at his side, challenged the conclusions of American intelligence agencies about Russian election interference.

The Buenos Aires session, which had been scheduled for Saturday on the sidelines of the Group of 20 economic summit meeting, was only the second to be canceled between top American and Russian or Soviet leaders since an American U-2 spy plane piloted by Francis Gary Powers was shot down over Russian territory in 1960. The other time came in 2013 when President Barack Obama called off a trip to Moscow to protest Mr. Putin’s decision to shelter Edward J. Snowden, the National Security Agency leaker.

Mr. Trump has adamantly denied any collusion with Russia during the campaign and dismissed questions about business ventures or economic interests in Russia. But Michael D. Cohen, his former personal lawyer and fixer, admitted in court on Thursday that he had engaged in negotiations for a Moscow tower well into the campaign and had personally briefed Mr. Trump and members of his family.

The president said that Mr. Cohen was “weak” and lying in order to reduce his sentence for various criminal charges, adding that while a Moscow tower had been considered, he had opted against it because he was running for president. But Mr. Trump insisted that there would have been nothing wrong with pursuing such a project as a candidate if he had.

Even as he denounced his former lawyer on Thursday morning, Mr. Trump told reporters that he still planned to go ahead with his meeting with Mr. Putin.

“I probably will be meeting with President Putin,” he told reporters on the South Lawn of the White House just after 10:30 a.m. as he left on the trip to Buenos Aires. “I think it’s a very good time to have the meeting.” He added that he would be getting a report on Air Force One about the Russia-Ukraine confrontation “and that will determine what I’m going to be doing.”

At 11:34 a.m., he reversed himself, announcing on Twitter that he would scrap the meeting after all, attributing the move to the Ukraine conflict. Russian forces seized three small Ukrainian naval vessels and more than 20 sailors on Sunday, including at least three wounded in a shooting by the Russian side.

“Based on the fact that the ships and sailors have not been returned to Ukraine from Russia, I have decided it would be best for all parties concerned to cancel my previously scheduled meeting in Argentina with President Vladimir Putin,” Mr. Trump wrote.

“I look forward to a meaningful Summit again as soon as this situation is resolved!” he added.

Sarah Huckabee Sanders, the White House press secretary, told reporters on Air Force One that Mr. Trump had scrubbed the meeting after reviewing the report on Russia’s actions against Ukraine. Mr. Trump conferred with Secretary of State Mike Pompeo and John F. Kelly, the White House chief of staff, who were on the plane, and by telephone with John R. Bolton, his national security adviser, who was in Brazil.

But a meeting with Mr. Putin also could have raised questions about Mr. Trump’s ties to Russia after Mr. Cohen’s revelations, producing an politically uncomfortable moment.

Russia analysts noted that nothing had changed in the Russian-Ukrainian standoff in days and that Mr. Trump had not seen it necessary to scratch the meeting before.

“This is a no-brainer,” said Michael Carpenter, senior director of the Penn Biden Center for Diplomacy and Global Engagement and a former Pentagon official under Mr. Obama.

“It’s all about the political optics in light of the Trump Tower Moscow news and the fact that Trump simply can’t bring himself to ever confront Putin in public,” Mr. Carpenter said. “This would have been a P.R. disaster of epic proportions if he had agreed to meet and not confronted Putin.”

Once again, however, Mr. Trump’s ad hoc decision-making caught a foreign government unawares. Dmitri S. Peskov, the Kremlin spokesman, told Russian reporters that they had seen Mr. Trump’s Twitter posting but had no other word from the American government.

“We don’t have official information,” he said, according to the Tass news agency. He added, “If this is so,” then Mr. Putin “will have a few additional hours in the schedule for useful meetings on the sidelines of the summit.”

Other sub-dramas were percolating in Buenos Aires as Mr. Trump flew on Thursday. The president downgraded scheduled meetings with two allies, Presidents Moon Jae-in of South Korea and Recep Tayyip Erdogan of Turkey, without explanation. Instead of full-fledged sessions, the president will have “pull-asides” with both, according to the White House, meaning casual chats on the sideline of the main sessions.

At the same time, speculation focused on whether Prime Minister Justin Trudeau of Canada would attend the ceremonial signing on Friday of the revised version of the North American Free Trade Agreement, which Mr. Trump has rebranded the United States-Mexico-Canada Agreement. Mr. Trudeau’s schedule did not include the ceremony, but a Canadian official late Thursday confirmed that he would attend.

And then there was Chancellor Angela Merkel of Germany, who also has a tense relationship with Mr. Trump and was scheduled to meet with him on Friday. Her government plane was forced to land en route to Buenos Aires by technical difficulties and she was reported to be turning to a commercial flight on Friday, an embarrassment for the leader of a major power.

Assuming they do meet, Mr. Trump and Ms. Merkel will presumably discuss the Ukraine crisis. While Mr. Trump had said earlier in the week that he was not happy about Russia’s latest aggression, he had left any stronger denunciation to his United Nations ambassador. Members of Congress on both sides of the aisle had called on Mr. Trump to take a tougher stance and even cancel the meeting with Mr. Putin.

Mr. Trump had been seeking another meeting with Mr. Putin for months, first suggesting the Russian leader visit the White House and later trying to arrange to sit down together in Paris earlier this month, but neither idea went ahead. Instead, the two leaders settled on Buenos Aires for their next meeting.

The session was already freighted by multiple tension points between the two countries in addition to the lingering issues of the election meddling and the clash with Ukraine.

Some veteran diplomats said the scrubbed meeting was a missed opportunity to pressure Mr. Putin into easing the conflict with Ukraine and to find a possible compromise that would enable them to salvage the I.N.F. Treaty.

“I would have preferred that he had stuck with the meeting and delivered a strong rebuke to Putin for Sunday’s aggression, with a threat of punitive steps if Russia doesn’t quickly release the ships and the crews,” said Alexander Vershbow, who served as ambassador to Russia under President George W. Bush.

“But given that Trump may be incapable of doing that, and might have endorsed Putin’s ‘vigorous denials’ that Russia was responsible,” he added, “cancellation may have been the best course.”

Molly McKew, a consultant who has advised the leaders of governments threatened by Moscow, said Mr. Trump clearly wanted to avoid having to confront Mr. Putin directly over Ukraine. “Since he doesn’t have the constitution to say it to Putin’s face, he sent it as a tweet,” she said. “In many respects — and to avoid Helsinki 2.0 — this is probably the best outcome. He can say he did it and not end up looking the fool.”

Neil MacFarquhar contributed reporting from Moscow.

A version of this article appears in print on , on Page A8 of the New York edition with the headline: Trump Cancels Talks With Putin, Citing Russian Aggression. Order Reprints | Today’s Paper | Subscribe