Donald Trump and Martha Stewart attend The New York Observer Relaunch Event on April 1, 2014 in New York City.

The president earlier announced that he would pardon conservative pundit Dinesh D'Souza .

"He shouldn't have been put in jail," the president said.

"I think to a certain extent Martha Stewart was harshly and unfairly treated," the president said while on a flight to Texas, explaining why she could be pardoned. He also said that he believed Blagojevich was treated "unfairly," while noting that the Illinois politician is a Democrat.

President Donald Trump on Thursday said he was considering a pardon for celebrity chef and television personality Martha Stewart , as well as commuting the sentence of disgraced former Illinois Gov. Rod Blagojevich.

Former Illinois Governor Rod Blagojevich prepares to deliver a statement on his last full day of freedom at his Chicago home on Wednesday, March 14, 2012.

Stewart, who was convicted of multiple felony charges in 2004, was prosecuted by former FBI Director James Comey, and served five months in federal prison on charges related to a 2001 stock sale.

Comey was fired by Trump last year and has since become an outspoken critic of his administration.

Trump has shared mixed opinions about Stewart in the past.

In a 2006 letter to Stewart, the president blamed her for the poor ratings of NBC's "The Apprentice: Martha Stewart," a spinoff of Trump's "The Celebrity Apprentice."



The next month, he said of Stewart: "She's a wonderful woman."

Years later, in a 2013 tweet, Trump wrote: "She looks terrific, better than ever, any guy would be lucky to be with her."

I watched @todayshow this AM re: @MarthaStewart & dating. She looks terrific, better than ever, any guy would be lucky to be with her.

Patrick Fitzgerald, a personal friend of James Comey, oversaw the prosecution of Blagojevich on public corruption charges in 2011. Fitzgerald joined Comey's legal team following the former FBI director's firing last year.

Blagojevich is in the sixth year of a 14-year sentence in Colorado prison. The Illinois Democrat was found guilty of attempting to trade the U.S. Senate seat vacated by Barack Obama for money or favors.

"I am seriously thinking about – not pardoning – but I am seriously thinking of a curtailment of Blagojevich," the president said Thursday, before a reporter offered the word "commutation."

In a statement, the former governor's wife, Patti Blagojevich, said the president's comments were encouraging.

"[Trump has] given us something that has been hard to come by recently…hope," she said. "From the beginning, we've eagerly awaited the day when Rod could come back home where he belongs, and we continue to pray our family will be made whole again soon."

Blagojevich also has a connection to Trump's "The Celebrity Apprentice," appearing on she show in Spring 2010. Trump noted that Blagojevich was on the show "for a short time" in his remarks about the potential commutation.

Representatives for Stewart did not immediately respond to requests for comment.