President Trump knew about a six-figure payment that Michael D. Cohen, his personal lawyer, made to a pornographic film actress several months before he denied any knowledge of it to reporters aboard Air Force One in April, according to two people familiar with the arrangement.

How much Mr. Trump knew about the payment to Stephanie Clifford, the actress, and who else was aware of it have been at the center of a swirling controversy for the past 48 hours touched off by a television interview with Rudolph W. Giuliani, a new addition to the president’s legal team. The interview was the first time a lawyer for the president had acknowledged that Mr. Trump had reimbursed Mr. Cohen for the payments to Ms. Clifford, whose stage name is Stormy Daniels.

It was not immediately clear when Mr. Trump learned of the payment, which Mr. Cohen made in October 2016, at a time when news media outlets were poised to pay her for her story about an alleged affair with Mr. Trump in 2006. But three people close to the matter said that Mr. Trump knew that Mr. Cohen had succeeded in keeping the allegations from becoming public at the time the president denied it.