From his Fox News pulpit, Sean Hannity has been one of the most ardent supporters of President Trump, cheering his agenda and excoriating his enemies.

He has gone from giving advice on messaging and strategy to Mr. Trump and his advisers during the 2016 campaign to dining with him at the White House and Mar-a-Lago.

Now, Mr. Hannity finds himself aligned even more closely with the president.

During a hearing at a packed courtroom in Lower Manhattan on Monday, he was named as a client of Mr. Trump’s longtime personal lawyer and fixer, Michael D. Cohen.

That revelation nudged the conservative commentator into the orbit of those who have lately come under legal scrutiny related to the investigations of Mr. Trump and his associates by the special counsel, Robert S. Mueller III, and the United States attorney’s office in Manhattan. Both inquiries have provided fodder for Mr. Hannity’s prime-time cable show and nationally syndicated radio program.