With the speech, Mr. Trump sought to move past a tumultuous week that began with his disparaging members of a Gold Star military family who had spoken out against him at the Democratic National Convention. Mr. Trump’s remarks drew rebukes from many Republicans, including Mr. Ryan, Mr. McCain and Ms. Ayotte, and set the course for the next few days. He caused a tempest with his remarks regarding Mr. Ryan and another with repeated proclamations about viewing a “secret tape” that showed Iran receiving pallets of cash from the United States.

Perhaps signaling that he was in a forgiving and unifying mood, Mr. Trump on Friday morning issued a rare admission of an error, explaining on Twitter that the footage he had thought was a secret tape was instead a widely shown clip of American prisoners arriving in Geneva after being released by Iran.

His squabbling with Mr. Ryan and the senators threatened to further splinter Mr. Trump’s relationship with the party and infuriated many officials, including Reince Priebus, the chairman of the Republican National Committee. Mr. Trump’s running mate, Gov. Mike Pence of Indiana, publicly, but peacefully, disagreed with him and backed Mr. Ryan.

Mr. Priebus had made clear he hoped that Mr. Trump would get behind Mr. Ryan and the senators but told the nominee that he had to make the decision on his own.

The endorsement of Mr. Ryan is unlikely to assuage some Republicans who are concerned by the combative Trump campaign and have grown frustrated that the near-daily controversies have made it more difficult to focus on Mrs. Clinton, the Democratic nominee. On Friday, Gov. John Kasich of Ohio told CNN that he was considering voting Democratic for the first time.

“Let’s not get ahead of ourselves,” Mr. Kasich said in response to a question on the possibility that he would not vote for a Republican for president. He added: “I wish that I could be fully enthusiastic. I can’t be. So I don’t know what’s going to happen at the end.”