The federal investigation into former Trump attorney Michael Cohen began nearly a year before agents raided his home and business in April 2018, newly unsealed court documents revealed Tuesday.

The massive trove of files, pertaining to the government's search warrants, showed that federal investigators obtained a warrant for emails from Cohen’s Gmail account “on or around July 18, 2017.” The emails that were obtained and reviewed were dated between Jan. 1, 2016 and July 18, 2017.

ANOTHER TOP PROSECUTOR EXITS ROBERT MUELLER'S TEAM, RAISING SPECULATIONS INVESTIGATION IS NEARING ITS END

Weeks later, the FBI sought and obtained a search warrant -- on or around Aug.  8, 2017 -- for communications and records stored in Cohen’s iCloud account. In November 2017, the FBI sought and obtained a separate search warrant for Cohen’s Gmail account, related to communications “sent or received between June 1, 2016, and November 13, 2017.”

Cohen ultimately pleaded guilty to a range of charges related to bank and tax fraud, campaign finance violations and making false statements to Congress. The latter arose from Special Counsel Robert Mueller's investigation, but the rest of the charges came from an investigation handled by New York federal prosecutors. Cohen, who recently delivered explosive testimony to Congress critical of Trump, is expected to report to prison in May to serve a three-year sentence.

The documents unsealed Tuesday show that Mueller was investigating Cohen until February 2018, before turning the case over to prosecutors with the Southern District of New York. The documents show that Mueller’s team was reviewing all communications and records from the warrant, specifically related to Cohen’s relations with foreign entities and whether he was acting as an unregistered foreign agent.

The court files documented Mueller's handoff to the SDNY.

“The SCO has since referred certain aspects of its investigation into Cohen to the USAO, which is working with the FBI’s New York Field Office,” the court files state. “As part of that referral, on or about Feb. 8, 2018, the SCO provided the USAO with all non-privileged emails and other content information obtained pursuant to the Cohen email address and Cohen iCloud account.”

Cohen, who has been criticized for his unregistered foreign contacts and relationships, was never charged with failing to register as a foreign agent under the Foreign Agents Registration Act (FARA).

But Tuesday’s court filings detail Cohen’s financial exchanges with foreign entities—including Russia-linked U.S.-based company Columbus Nova; Swiss pharmaceutical company Novartis; a South Korean company; and a Kazakhstani bank. All entities transferred hundreds of thousands of dollars into a Cohen bank account dubbed “Essential Consulting”—the account that ultimately paid former adult film star, Stormy Daniels. In total, between January 2017 and January 2018, Cohen received nearly $2.9 million in transfers and checks from foreign entities.

Despite getting initial warrants nearly a year prior, the FBI did not conduct the raid of Cohen’s home, office and hotel room until April 9, 2018. Agents scooped up evidence related to several issues including his relations with foreign entities, his personal business dealings involving taxi medallions, and his payments to Daniels in the weeks leading up to the 2016 presidential election to cover up an alleged affair with then-candidate Donald Trump.

ROSENSTEIN HANGING ON AT DOJ AMID MUELLER PROBE WIND-DOWN, DESPITE PLANS TO LEAVE BY NOW

The newly released documents reference an “Illegal Campaign Contribution Scheme,” but all sections related to that topic are completely redacted. The heavy redactions signal that the hush-money payments could still be a factor in Mueller's Russia probe.