Donald Trump’s deputy campaign chairman Rick Gates was in direct communication with a person he knew was a Russian spy in the weeks ahead of the 2016 election, according to court documents filed by special counsel Robert Mueller Tuesday.

The documents reveal Gates was in contact with a former officer in Russian military intelligence in the months leading up to Trump’s win.

Gates was “directly communicating in September and October 2016” with an unidentified person who “has ties to a Russian intelligence service and had such ties in 2016,” the filing says.

Crucially, Gates was aware of this person's ties to Russian intelligence, the filing adds, calling the 2016 conversations “pertinent to the investigation.”

Gates last month struck a plea deal with Mueller, likely avoiding decades behind bars. Yet it remains unclear what information the former Trump official offered in return.

Gates is likely helping Mueller probe his former business partner and Trump campaign chairman Paul Manafort, who has pleaded not guilty to conspiracy, money laundering and tax and bank fraud charges.

The unnamed intelligence officer, referred to as “Person A” in the documents, worked for one of Manafort’s companies. The Washington Post claims the description matches that of Konstantin Kilimnik, the manager of Manafort’s lobbying office in Kiev.

Though Manafort left the campaign in August 2016, Gates remained at Trump’s side throughout the election, helping with the transition period, the inauguration, and the early days in the White House.

“He saw everything,” a Republican consultant who worked with Gates on the campaign told Politico. Another defense attorney in the Mueller case noted that Gates’ plea had triggered a palpable alarm inside the West Wing.

Gates’ co-operation has increased pressure on Manafort to likewise flip and provide Mueller with information on Trump and other senior campaign aides. Manafort faces the rest of his life behind bars if he’s found guilty of the charges.

The revelations were part of a court filing relating to the upcoming sentencing hearing of Dutch lawyer Alex van der Zwaan, who has pleaded guilty to lying to Mueller's investigators. He is seeking to avoid jail time as his wife is about to give birth to their first child.