PARIS — President Trump said on Wednesday that he had confronted President Vladimir V. Putin twice about whether Russia meddled in the 2016 presidential election, and changed the subject after Mr. Putin flatly denied it because, “What do you do? End up in a fistfight?”

Speaking to reporters on Air Force One as he flew to Paris to take part in Bastille Day celebrations, Mr. Trump offered his first extended account of a dramatic closed-door meeting he held with Mr. Putin last week in Hamburg, Germany.

“I said to him, ‘Were you involved in the meddling with the election?’” Mr. Trump recalled. “He said, ‘Absolutely not. I was not involved.’ He was very strong on it. I then said to him, in a totally different way, ‘Were you involved with the meddling?’ He said, ‘I was not — absolutely not.’”

At that point, he said, Mr. Putin shifted the conversation to the war in Syria.

Mr. Trump conceded that he did not ask Mr. Putin a question about the election that he wanted to ask: “Who were you really for? Because I can’t believe that he would have been for me. Me. Strong military, strong borders — he doesn’t care about borders — but strong military. Tremendous.”