“The optics couldn’t be any worse,” said Mr. Weiss, who has held several government national security posts.

“The U.S.-Ukraine relationship has basically imploded” amid the impeachment storm in Washington and questions about Mr. Trump’s commitment to the country’s security, he said. “The Russians surely arranged the Lavrov visit to capitalize on all of this and to send a message to the Ukrainians that they’re basically on their own now and need to cut the best deal they can since the U.S. backstop is largely inoperative.”

Mr. Pompeo and Mr. Lavrov also discussed arms control and a potential extension of the Obama-era New Start treaty, which limits the number of nuclear weapons deployed by the two nations. Mr. Trump has criticized conditions of the treaty, which expires in February 2021. Last week, President Vladimir V. Putin of Russia offered to extend it with no preconditions, and Mr. Lavrov said on Tuesday that Moscow was ready to act on that.

But Mr. Pompeo sounded cool to the idea, stressing the administration position that the United States would agree to a new treaty only if China was part of it. The White House said Mr. Trump delivered the same message. Chinese officials have balked at any such suggestion, since China’s nuclear arsenal is a small fraction of the size of those of the United States and Russia.

If the United States and Russia do successfully negotiate an extension of the nuclear treaty, Mr. Trump would be able to advertise a significant diplomatic win while campaigning for re-election in 2020.

Mr. Pompeo said the two sides spoke about sanctions enforcement on North Korea, which has recently threatened to resume testing of nuclear weapons and long-range ballistic missiles. Mr. Lavrov said he hoped that Washington and Pyongyang would restart diplomacy. He added that dialogue must be based on “reciprocal steps,” saying, “You cannot demand that North Korea do everything.”

Since the start of his presidency in early 2017, Mr. Trump has been dogged by accusations that his public affection for Mr. Putin and efforts to create warmer ties between the two nations undermine the national security interests of the United States. American intelligence agencies agree that Russia interfered in the 2016 presidential election, a conclusion backed up by the investigation by Robert S. Mueller III, the special counsel, even though he did not find a conspiracy between members of the Trump campaign and Russian officials.