The judge who handed down the sentence blasted the notorious dirty trickster,describing his behaviour as"a threat to our most fundamental institutions".
The sentence came despite what the judge described as Gates'"extraordinary"cooperation with special counsel Robert Mueller's Russia probe.
Comey said he was wrong when he said last year that applications for surveillance of a Trump aide were handled in a"thoughtful,responsible way".
The Russia probe began after Alexander Downer told a US official that George Papadopoulos had suggested Russia may have dirt on Trump's presidential rival Hillary Clinton.
Donald Trump met with Russia's top diplomat on Tuesday. The US President may or may not have"warned"the Putin regime.
The tweet was a rare direct attack on Wray,who has largely been spared the public ire Trump vented at former FBI Director James Comey.
Andrew McCabe,then the FBI's deputy director,said that Downer's information was the"tipping point"that led the FBI to open the investigation.
The ruling could have significant implications for the impeachment inquiry into Donald Trump,who has tried to block his staff from testifying.
The allegation prompted Trump to say that the FBI had tried to"overthrow the presidency".
Madagascar has little obvious strategic value for the Kremlin or the global balance of power. But Russians were there offering bribes,spreading disinformation and recruiting an apocalyptic cult leader.
Prosecutors said the Republican lied to Congress about his efforts to keep abreast of WikiLeaks damaging Hillary Clinton emails dump.