The FBI was looking into Michael Cohen, President Trump’s longtime lawyer and fixer, for almost a year before agents raided his home and hotel room last April, according to court documents.

Details about the probe into Cohen, who pleaded guilty in November, were revealed Tuesday morning with the release of hundreds of pages of redacted materials related to the feds’ investigation into Cohen.

They show that special counsel Robert Mueller got court-approved warrants in July 2017 to search Cohen’s emails.

In February 2018, Mueller, who is probing Russian influence in the 2016 election and collusion on the part of Trump or his campaign associates, handed over those emails to federal prosecutors in Manhattan.

The FBI searched Cohen’s home, office and hotel room on April 9.

The Manhattan federal judge presiding over the criminal case against Cohen approved the release of search materials related to Cohen’s charges of bank fraud and lying to a financial institution but is allowing prosecutors to keep materials related to his campaign finance violations secret.

Cohen pleaded guilty to lying to Congress and violating campaign finance laws and is scheduled to report May 6 to begin serving his three-year sentence.