WASHINGTON—Michael Cohen, a former lawyer for President Trump, directed his attorney last spring to inquire about the possibility of a presidential pardon, weeks after federal agents raided his properties, Mr. Cohen’s lawyer said Wednesday, apparently contradicting his testimony before a House committee last week.

The Wall Street Journal previously reported that Stephen Ryan, Mr. Cohen’s attorney at the time, discussed the possibility of a pardon with lawyers for Mr. Trump in the weeks after the Federal Bureau of Investigation in April raided Mr. Cohen’s home, office and hotel room. The president’s lawyers, including Jay Sekulow, Rudy Giuliani and Joanna Hendon, dismissed the idea of a pardon at the time, people familiar with the discussions said. But at least one of them, Mr. Giuliani, left open the possibility that the president could grant Mr. Cohen one in the future, they said.

In testimony before the House Oversight Committee last week, Mr. Cohen said: “I have never asked for, nor would I accept, a pardon from Mr. Trump.”

Lanny Davis, a lawyer for Mr. Cohen, said Wednesday that in the months after the FBI raid, Mr. Cohen was open to a pardon from the president.

“During that time period, he directed his attorney to explore possibilities of a pardon at one point with Trump lawyer Rudy Giuliani as well as other lawyers advising President Trump,” Mr. Davis said. He referred to the discussions with the president’s lawyers as the “ongoing ‘dangling’ of a possible pardon by Trump representatives privately and in the media.”