The pardon was only the third of Mr. Trump’s presidency but amounted to a dramatic coda to a politically charged case that once gripped Washington and came to embody the divisions over the Iraq war. Mr. Libby, who goes by Scooter, was seen by his critics as an agent of a war built on false intelligence about weapons of mass destruction and by his friends as a scapegoat for a special prosecutor who was actually trying to bring down Mr. Cheney.

Mr. Libby has long maintained his innocence, arguing that his conviction rested on a difference of memories. President George W. Bush commuted his 30-month prison sentence while refusing to give a full pardon, saying he respected the jury’s verdict. But Mr. Libby’s hopes of overturning his conviction took a turn in 2015 when Judith Miller, a former New York Times reporter and a key witness at his trial, recanted her testimony, and a year later a court reinstated his law license.

Victoria Toensing, a lawyer and friend of Mr. Libby’s, said on Friday that she brought his case to the attention of the White House Counsel’s Office over the summer. Ms. Toensing and her husband and law partner, Joseph diGenova, were briefly set to work for Mr. Trump as private lawyers last month until they backed out, citing a client conflict.

Ms. Toensing would not indicate whether she discussed Mr. Libby directly with Mr. Trump, but she did say that the president called her on Friday to notify her that he had signed the pardon. She then called Mr. Libby to give him the news, but he had just undergone an M.R.I. for a back problem and “was a little hazy,” so she told his wife, Harriet.

“It’s taken a long time to get the right thing to happen,” Ms. Toensing said. “As a former prosecutor and as a defense attorney, I’m appalled by what happened.”