WASHINGTON — Rudy Giuliani may have added to the legal headaches of his new law client and old friend, President Donald Trump, when he drew a link Thursday between a hush money payment to a porn actress and the potential fallout if her allegations of a tryst with Trump had gone public before the 2016 election.

Giuliani, the former New York City mayor and U.S. attorney, said in a series of interviews that Trump reimbursed his personal lawyer, Michael Cohen, for a secret $130,000 payment to adult-film star Stormy Daniels in October 2016. Trump himself acknowledged the reimbursement in tweets Thursday morning after previously denying he knew about the payment.

Both Trump and Giuliani insisted that the reimbursement was made from Trump's personal funds and that the initial payment had nothing to do with the campaign. But then Giuliani made the link himself, telling "Fox & Friends": "Imagine if that came out on Oct. 15, 2016, in the middle of the last debate with Hillary Clinton."

Several experts in campaign finance law, who already had raised questions about the payment, said the case that the payment violated federal law had only grown stronger.

"I can say that Giuliani has done Trump no favors, especially this morning when he suggested Trump's motive was campaign-related. That's a huge deal," Richard Hasen, an election law expert at the University of California at Irvine, wrote in an email.

Trevor Potter, president of the nonpartisan Campaign Legal Center, said Giuliani's statement that the payment kept Daniels' allegation from the public "is an admission that the confidentiality agreement and the timing of the payment influenced the 2016 elections."

The payment was not reported by the Trump campaign, and if it were to be counted as a contribution, it would vastly exceed the $2,700-per-election limit. If the money could be construed as a loan from Trump, it would still have to be reported but would not be subject to any limits, Hasen said.

Watchdog groups had previously filed complaints about the payment with the Federal Election Commission, the Office of Government Ethics and the Justice Department. There can be both civil and criminal penalties if investigators determine that the campaign or Cohen intended to keep the payment secret.

But this is not an easy standard to prove in court, said Jan Baran, a longtime elections and ethics lawyer. Prosecutors failed to get a conviction against Democratic Sen. John Edwards of North Carolina on charges that he received illegal contributions and falsified documents to pay for the silence of his pregnant mistress as he campaigned for president in 2008.

"If anything, the facts surrounding Mr. Edwards were arguably more campaign-related than what is happening today," Baran said.

Questions swirled Thursday about why Giuliani and Trump decided to acknowledge that the president had reimbursed Cohen.

Norm Eisen, who served as an ethics lawyer in the Obama White House and now chairs the left-leaning Citizens for Responsibility and Ethics, which has repeatedly challenged Trump, said it might have to do with the fact that Cohen is under criminal investigation in New York. FBI agents raided his home and office several weeks ago seeking records about the nondisclosure agreement.

"I think the other intention here apparently was to tear the Band-Aid off and to get out in public whatever Cohen might offer should he choose to cooperate," Eisen speculated.

Former New Jersey Gov. Chris Christie, a Republican, embraced a similar possible explanation.

"You know, there's an old saying in the law: 'Hang a lantern on your problems.' So he comes in, he knows that there's been different stories being told about this payment and how it was made," Christie, a friend of Trump's, told ABC News. "So the fact is that Rudy has to go out there now and clean it up. That's what lawyers get hired to do. So he goes out there and he puts it out rather than having some reporter give breaking news that the president reimbursed it."

Baran, however, offered caution about drawing too many conclusions.

"We are dependent on what facts we know today and, as we know with President Trump, facts can change on a daily, if not hourly, basis," he said.