“Speaker Ryan, you come in with all your swagger and experience and you sell ’em a bill of goods, which ends up a complete and total failure, and you allow our president in his first 100 days to come out of the box like that, based on what?” Ms. Pirro said.

On Fox News on Sunday, Mr. Trump’s chief of staff, Reince Priebus, an ally of Mr. Ryan’s, said he had not spoken to the president about the Twitter post, but he called the timing “coincidental.”

Brendan Buck, a spokesman for Mr. Ryan, said, “The speaker and president talked for an hour yesterday about moving forward on the agenda, and their relationship is stronger than ever right now.”

Another spokesman in Mr. Ryan’s office said on Sunday: “The two spoke again today, and the president was clear his tweet had nothing to do with the speaker. They are both eager to get back to work on the agenda.”

On Friday, after House Republicans pulled the health care bill, Mr. Trump voiced support for Mr. Ryan, saying the speaker had worked “very, very hard.” A person close to the president said that aides did not believe that Mr. Trump had spoken with Ms. Pirro before his Twitter post, or that he was trying to advertise criticism of Mr. Ryan’s leadership.