HAMBURG, Germany — President Trump questioned President Vladimir V. Putin of Russia on Friday about Moscow’s interference in the 2016 election, using their epic first face-to-face meeting to directly raise what has become a vexing political issue for the White House.
Mr. Putin denied any meddling, and aides for each offered differing versions of the exchange. But both sides said the two leaders quickly turned to a discussion of how they could work together, including on combating cyberattacks and de-escalating the war in Syria.
The meeting, which lasted for more than two hours on the sidelines of the Group of 20 summit meeting, was so all-consuming that even Mr. Trump’s wife, Melania, failed in her attempt to pry the two leaders apart halfway through so Mr. Trump could keep his later appointments.
Rex W. Tillerson, the secretary of state, said that Mr. Trump had confronted Mr. Putin in a “robust and lengthy” discussion and that Mr. Putin had denied involvement in any election interference. Foreign Minister Sergey V. Lavrov of Russia, the only other official in the meeting, said Mr. Trump had accepted Mr. Putin’s denial.
Both aides were trying to present their leaders as having stood their ground.
The relationship between the United States and Russia right now is so fraught, so mired in distrust, disruption, power plays and cybersabotage, that the best Mr. Putin and Mr. Trump could get away with was setting up mechanisms to talk about their differences.
Mr. Trump entered the meeting hoping to put an end to the scrutiny over his election. Mr. Putin wanted a way out of the Western sanctions that have hobbled the Russian economy since he annexed Crimea and interfered in Ukraine.
Neither got what they wanted.
By the end of the day, the two countries had taken only baby steps. There was a newly appointed American special envoy implementing the accords reached on Ukraine. There was another cease-fire agreement for a slice of Syria. There was some kind of unspecified process for a new kind of arms control — not nuclear arms, but cyberarms, vaguely focused on everything from election interference to the sabotage of each other’s computer networks.
Mr. Trump knew that any concession to the savvy Russian leader would lead to accusations that he was, in the end, rewarding Russia’s bold attempt to sway American voters. Mr. Putin, in the end, appears to have settled on a long game, convinced that his mix of information warfare, “active measures” and low-level aggression will ultimately get him what he wants, a restoration of Russia’s status.
It is far too early to know if even those steps will amount to anything; they seemed intended to show that each man regarded the other as someone they could do business with.
And Mr. Trump exited the meeting as he entered: with much of his country wondering why he has said far harsher things about his closest allies, including his host in Germany, Chancellor Angela Merkel, than about the authoritarian leader he engaged for more than two hours.
The Trump-Putin meeting eclipsed the rest of the agenda at the Group of 20 summit meeting. But the talks with Mr. Putin oddly turned into a bright spot for Mr. Trump on the first full day of the gathering, where the United States found itself increasingly ostracized by other Group of 20 members on major issues, including climate change, immigration and trade.
The meeting itself was darkened by protests that turned violent on Friday as more than 10,000 demonstrators took to the streets, confronted by phalanxes of riot police with water cannons, pepper spray and clubs. Dozens were injured in clashes that left cars burned and windows shattered in parts of the city.
For Mr. Trump, however, the main focus, at least for part of the day, was trying to move past an issue that has caused him political problems at home.
American intelligence agencies have said that Russia conducted cyberattacks, hacking and propaganda designed to undermine Mr. Trump’s Democratic opponent, Hillary Clinton, to help him win the election last year. The Justice Department has named a special counsel to investigate Russia’s interference in the campaign and whether Trump associates colluded with Russia.
In a stark shift, Mr. Trump, who had equivocated as recently as the day before over whether Moscow was solely responsible for the 2016 hacking, broached the subject with Mr. Putin, telling him that Americans were concerned about Russia’s interference. But he threatened no consequences for the meddling, and when Mr. Putin denied it, he agreed that the two must get past an issue that had become a “substantial hindrance” in the United States-Russia relationship, Mr. Tillerson said.
“The president’s rightly focused on, ‘How do we move forward from what may be simply an intractable disagreement at this point?’ ” Mr. Tillerson told reporters after the meeting. He said the two focused on how the United States could secure a commitment from Russia that it would not seek to disrupt American democracy, or that of other countries, in the future.
“There was not a lot of relitigating of the past,” Mr. Tillerson said.
Russian officials provided an alternative account, asserting that Mr. Trump had accepted Mr. Putin’s denial of the election interference and had even said that some in the United States were “exaggerating” Moscow’s role without proof.
Mr. Lavrov told reporters that “President Trump said that he heard the clear statements of President Putin that this is not true, and that the Russian leadership did not interfere in these elections, and that he accepts these statements.”
Mr. Trump, according to Mr. Lavrov, “mentioned that certain circles in the U.S. are still exaggerating, although they cannot prove this, the topic of Russia’s interference with the U.S. election.”
Both sides agreed that the two leaders had been eager to pivot from the dispute and discuss other matters, including a new effort to combat cyberthreats and a cease-fire to begin as early as Sunday in a limited area of southwestern Syria.
While such a step in Syria would be small, it appeared to reflect a desire by American and Russian officials to move past their tense flare-ups over the Syria conflict and facilitate a way to end the six-year civil war there. Moscow has been backing the government of President Bashar al-Assad of Syria while the United States has sought to aid opposition groups fighting to oust him.
“I think this is our first indication of the U.S. and Russia being able to work together in Syria,” Mr. Tillerson said.
Trump administration officials had said that Mr. Trump and Mr. Putin would discuss the idea of partnering to establish “safe zones” in Syria as part of Mr. Trump’s efforts to usher in a new era of cooperation with Moscow.
Announcing it on Friday gave Mr. Trump a tangible achievement coming out of a risky and heavily scrutinized meeting with Mr. Putin, which had been fraught with expectations and suspicion amid the Russia investigations. Members of Congress in both parties had said it would be diplomatic malpractice for Mr. Trump not to broach the issue of Moscow’s election hacking during the session.
And some signaled they were not satisfied even after Mr. Trump exceeded expectations by raising the election interference.
Senator Jack Reed of Rhode Island, the ranking Democrat on the Armed Services Committee, said that Mr. Trump had “capitulated” to Mr. Putin on the issue.
“Putin and Trump may both wish to ‘move forward,’ ” Mr. Reed said, quoting Mr. Tillerson’s account of how the conversation unfolded, “but the American people and the rest of the free world are all saying ‘wait a minute, let’s figure out what happened here and how to protect ourselves from repeat offenses.’ ”
Mr. Putin is known to prepare extensively for international meetings, surrounded by canny career diplomats like Mr. Lavrov, and in close contact with his old associates in the intelligence services. Mr. Trump, by contrast, was given relatively few written briefing materials, aides said, demanded that attendees be limited to two officials per side, and has publicly criticized American intelligence agencies during overseas trips.
White House officials had been determined that Friday’s meeting would not be a repeat of one Mr. Trump held in the Oval Office in May with Mr. Lavrov and Ambassador Sergey I. Kislyak, when he was photographed in images broadcast by Russian state media grinning and clasping hands warmly with the Russian officials. In the end, though, Mr. Tillerson said the two leaders quickly bonded, and their body language indicated as much.
Before they spoke privately, the presidents smiled, shook hands and praised each other in front of reporters, saying they hoped for a productive relationship.
“President Putin and I have been discussing various things, and I think it’s going very well,” Mr. Trump said, as both men sat spraddle-legged in chairs arranged side by side. They clasped hands and leaned in to listen to each other.
“We look forward to a lot of very positive happenings for Russia, and for the United States, and for everybody concerned. And it’s an honor to be with you,” he told Mr. Putin.
Mr. Putin said he was happy to have the chance to meet Mr. Trump: “We spoke over the phone, but phone conversations are never enough, definitely.”
He added, “I hope that, as you have said, our meetings will yield positive results.”
Officials from both sides made sure that was the case. Shortly before the meeting, Mr. Tillerson announced he had named a new envoy, Kurt Volker, to negotiate a resolution to the conflict in Ukraine, where Russia has backed separatists and continued to interfere in violation of a peace agreement. Mr. Putin and Mr. Lavrov discussed the situation in Ukraine, said Mr. Tillerson, who was to travel with Mr. Volker, a former NATO ambassador and official at the National Security Council, to Kiev on Sunday. The State Department said he would hold regular meetings with Ukraine, Russia, Germany and France.
There was no word on whether Mr. Putin asked Mr. Trump to consider lifting the sanctions the United States has imposed on Russia as a result of its activities in Ukraine and annexation of Crimea or the election hacking. There was also no indication of whether Mr. Putin raised the possibility of reclaiming two diplomatic compounds seized by the Obama administration as retaliation for Moscow’s interference in the 2016 contest. Mr. Tillerson did not respond to a reporter’s shouted question on the matter.
But just as the lengthy closed-door talks were winding down, the Trump administration gave word of the cease-fire agreement on Syria, ensuring that the two presidents would have something productive to show for a session that was originally scheduled to last for just 30 minutes.
“There’s so much for us to talk about,” Mr. Tillerson said. “And it was a good start.”