Just two months after special counsel Robert Mueller was appointed to investigate Russian meddling in the 2016 election, his team of prosecutors trained their sights on Michael Cohen. That’s one of the most surprising revelations from the almost 900 pages of search warrant materials in the Cohen case made public on Tuesday.

The documents help explain how prosecutors developed evidence that Cohen committed bank and tax fraud, conspired to defraud the U.S., and violated campaign finance laws by purchasing the silence of President Trump’s alleged former lovers.

Through warrants for Cohen’s home, office, hotel room, iPhones, bank safety deposit box, email accounts, and more, prosecutors built their case over some nine months. FBI agents working with Mueller’s office, and, after some of the case was handed off,

with the Manhattan U.S. Attorney’s office went back to judges in Washington, D.C. and New York City repeatedly to request permission to dig through Cohen’s communications.

Much of the section related to the campaign finance scheme is redacted, as it pertains to an ongoing federal probe into how Trump Organization executives facilitated the campaign finance scheme.

The investigation crescendoed with a raid on Cohen’s New York City properties in April 2018. Cohen ultimately agreed to cooperate, directly implicating the President in the hush money violations and efforts to cover up plans to develop a Trump Tower Moscow during the 2016 presidential campaign.

Cohen pleaded guilty to eight counts in the Manhattan probe at a dramatic August hearing, and agreed to cooperate with federal prosecutors. In November, he entered into a plea deal with the special counsel after admitting to lying in congressional testimony. He’s set to serve three years in prison.

We put together a timeline based on the newly unsealed documents to show exactly how the Cohen investigation came together.

May 17, 2017: Robert Mueller was appointed as special counsel following the abrupt firing of FBI Director Jim Comey.

July 18, 2017: FBI agents sought and obtained a search warrant from U.S. District Judge Beryl Howell in Washington, D.C., for all emails sent or received from Cohen’s Gmail account between Jan. 1, 2016 and July 18, 2017. The FBI said there was probable cause to believe that Cohen engaged in conspiracy to defraud the U.S., make false statements to financial institutions and banks, and acted as an unregistered foreign agent in violation of the Foreign Agents Registration Act.

Aug. 8, 2017: FBI agents sought and obtained a search warrant from Judge Howell for content stored in Cohen’s iCloud account.

Aug. 28, 2017: Cohen submitted a letter to the House and Senate Intelligence Committees providing false information about his work on the Trump Tower Moscow

Oct. 25, 2017: Cohen provided the same false information about his extensive work to develop the Trump Moscow project in closed-door testimony before the Senate panel

Nov. 7, 2017: The special counsel’s office sought and obtained a search warrant from Howell authorizing the “use of pen registers and trap and trace devices” that allowed them to find out who Cohen was calling and receiving calls from.

Nov. 13, 2017: The FBI successfully sought to broaden the timeline of the Cohen Gmail account emails it was seizing, asking for all message sent and received between June 1, 2015 and Nov. 13, 2017. The FBI also obtained permission from Howell to access all emails sent or received from a separate email account Cohen set up to engage in lucrative corporate consulting contracts through the newly-created firm Michael D. Cohen & Associates, P.C. Framing himself as the personal attorney to President Trump with close ties to the administration, Cohen received hundreds of thousands of dollars from entities like AT&T and Novartis. Columbus Nova, a private equity firm belonging to investor Andrew Intrater, a cousin of Russian oligarch Viktor Vekselberg, signed a $1 million consulting agreement with Cohen.

Nov. 20, 2017: The FBI obtained a search warrant to request additional information from Google and Apple for Cohen’s accounts. They asked for all information from June 1, 2015 onward.

Jan. 4, 2018: The special counsel sought and obtained from Howell an order “extending” the installation and use of pen registers and “trap and trace devices” to create a log of his phone records

Jan. 12, 2018: The Wall Street Journal broke the story that Cohen arranged a $130,000 hush money payment to adult film star Stormy Daniels one month before the 2016 election to keep her from going public about her alleged affair with Trump

Jan. 18, 2018: The Journal reported that Cohen used a private shell company, Essential Consultants LLC, to handle the hush money payments

Feb. 8, 2018: The special counsel “referred certain aspects of its investigation into Cohen” to the Manhattan U.S. Attorney’s office, “which is working with the FBI’s New York field office.” As part of that referral, Mueller’s team turned over emails and other materials obtained through search warrants to Manhattan prosecutors

Feb. 28, 2018: New York FBI agents received permission from Judge Gabriel Gorenstein to obtain a “black and red USB drive with a white label” containing emails related to Cohen’s various financial crimes, including the funds flowing into Essential Consultants LLC

March 7, 2018: The special counsel provided the Manhattan U.S. Attorney’s office with non-privileged material obtained from the iCloud warrant

April 7, 2018: The FBI was granted permission to obtain the location data of Cohen’s cell phones, retroactively requesting data from Oct. 1, 2016 to Nov. 8, 2016 and from Jan. 1, 2018 to April 7, 2018. An affidavit supporting the requests said that they were made in connection with an investigation into campaign finance violations.

April 9, 2018: The FBI raided Cohen’s office, Park Avenue home, and the room he was using at Manhattan’s Loews Regency hotel, seeking evidence of bank fraud and hush money payments to women