WASHINGTON — President Trump’s new legal team made a chaotic debut as Rudolph W. Giuliani, who was tapped recently to be one of the president’s lawyers, potentially exposed his client to legal and political danger by publicly revealing the existence of secret payments to Michael D. Cohen, the president’s personal lawyer.

After he moved into the White House, the president began paying Mr. Cohen $35,000 a month, Mr. Giuliani said, in part as reimbursement for a $130,000 payment that Mr. Cohen made to a pornographic film actress to keep her from going public about an affair she said she had with Mr. Trump. The president confirmed he made payments to Mr. Cohen in a series of Twitter posts on Thursday morning.

The explosive revelation, which Mr. Giuliani said was intended to prove that Mr. Trump and Mr. Cohen violated no campaign finance laws, prompted frustration and disbelief among the president’s other legal and political advisers, some of whom said they feared the gambit could backfire.

Legally, the failure to disclose the payments could be a violation of the Ethics in Government Act of 1978, which requires that federal officials, including Mr. Trump, report any liabilities of more than $10,000 during the preceding year. Mr. Trump’s last disclosure report, which he signed and filed in June, mentions no debt to Mr. Cohen.