Mr Trump was speaking about his "Buy American, Hire American" executive order and veered into addressing the North Atlantic Treaty Organisation (Nato), the 28-country military alliance which Mr Trump has called "obsolete" in the past.
He appeared to make a joke about how Mr Ryan had a good excuse for not being at the speech in the Speaker of the House's home state, because he was "with Nato".
“I said, Ron, you’ve got to get these countries to start paying their bills a little bit more,” he said, referring to Mr Ryan but calling him by Wisconsin Senator Ron Johnson's name.
Mr Trump added, “they’re way, way behind, Ron" regarding other countries' contributions to Nato.
He seemed to realised his error and pointed to Mr Johnson in the crowd: “I’m going to talk to you about that too, Ron.”
He later reverted to the correct name, saying: “Paul, you’re over with Nato. Get them to pay their bills, and Ron, you’ll have to work on that too."
The gaffe was somewhat surprising given the relationship between the the President and speaker. The two worked closely to try to pass the Republican replacement to the existing healthcare legislation Obamacare, but ultimately had to withdraw the bill before a vote due to lack of support within the party.