Michael Cohen, former personal attorney for U.S. President Donald Trump, exits the Loews Regency hotel and walks toward a taxi cab, July 27, 2018 in New York City.

Just days before federal agents raided Michael Cohen's home and office, Donald Trump's then-personal lawyer secured a $10 million agreement with a top donor, The Wall Street Journal reported citing people familiar with the matter.

The payment was conditional on Cohen securing funding for reactors at the Bellefonte Nuclear Power Plant in Alabama, sources told the Journal. That included a $5 billion loan from the federal government, the Journal reported.

Sources told the Journal that real-estate developer Franklin Haney also agreed to pay Cohen a monthly retainer. It reported that Haney's company still has a loan application pending at the Energy Department.

The newspaper said, however, it was not able to determine how much Haney ultimately paid Cohen, if at all. But sources told the Journal that Cohen's agreed success fee would be among the largest of his known consulting deals.

Last year, AT&T paid Cohen $600,000 for insight on how the Trump administration might approach its proposed merger with Time Warner, among other issues. Swiss pharmaceutical giant Novartis said it paid the lawyer $1.2 million to help the company navigate proposed changes to the Affordable Care Act.

Cohen is under criminal investigation by federal prosecutors in New York for his business dealings, as well as for a $130,000 hush-money payment he made to porn star Stormy Daniels right before the 2016 presidential election.

A lawyer for Haney told the Journal, "Neither Mr. Haney nor Nuclear Development LLC ever entered into a contract with Michael Cohen or his affiliate for lobbying services related to the Bellefonte project."

A representative for Cohen declined to comment to the Journal. The White House did not respond to Journal's request for comment.

A lawyer for Cohen did not immediately respond to CNBC's request for comment.

Read the full report in The Wall Street Journal.

— CNBC's Dan Mangan contributed to this report.