Donald Trump has attacked the director of the FBI before he gives testimony on a probe into links between the President’s campaign team and Russia.

James Comey is to outline results of a months-long investigation into potential coordination with the Kremlin publicly before members of Congress, although any information is expected to be heavily restricted.

Mr Trump has repeatedly denied the Kremlin played a role in his shock election victory and took to Twitter to launch a new attack late on Tuesday.

“FBI Director Comey was the best thing that ever happened to Hillary Clinton in that he gave her a free pass for many bad deeds!” he wrote.

“The phony Trump/Russia story was an excuse used by the Democrats as justification for losing the election. Perhaps Trump just ran a great campaign?”

The President appeared to be referring to a probe into Ms Clinton’s use of her family’s private email server for official communications, which prompted an investigation into alleged violations of federal laws and State Department protocol.

Comey confirms FBI is investigating Russian interference in the 2016 presidential election

Mr Comey recommended no charges be filed in July, effectively closing the case, but then announced an investigation into newly discovered emails on 28 October.

Mr Trump seized on the probe, calling his rival “crooked Hillary” and leading chants of “lock her up” at rallies as he lagged in polls, and it has been partly credited with his election victory despite closing two days before the vote.

Speaking at the Women for Women International's annual lunch in New York on Tuesday, Ms Clinton said she took responsibility for her election loss but believes the FBI investigation played a key part.

“If the election had been on 27 October, I would be your President,” the former Secretary of State said, adding that she was “on the way to winning until a combination of Jim Comey's letter and Russian WikiLeaks [Democratic email leaks] raised doubts in the minds of people who were inclined to vote for me and got scared off”.

Ms Clinton also said misogyny ”played a role in this election”, conceding she made mistakes but concluding: “The reason I believe we lost were the intervening events in the last 10 days."

The FBI and Congressional committees are now investigating alleged Russian interference in the vote after a US intelligence report concluded that “Vladimir Putin ordered an influence campaign” to damage Ms Clinton’s chances and undermine faith in the democratic process.

“We further assess Putin and the Russian Government developed a clear preference for President-elect Trump,” said the Office of the Director of National Intelligence.

US election 2016: the race for the White House in pictures Show all 12 1 /12 US election 2016: the race for the White House in pictures US election 2016: the race for the White House in pictures Republican U.S. presidential nominee Donald Trump shakes hands with Democratic U.S. presidential nominee Hillary Clinton at the conclusion of their first presidential debate at Hofstra University in Hempstead, New York Reuters US election 2016: the race for the White House in pictures President Barack Obama embraces Democratic nominee Hillary Clinton on stage at the party's convention in Philadelphia US election 2016: the race for the White House in pictures Donald Trump's wife Melania delivered a speech at the GOP convention in Cleveland that was later found to have been cribbed in part from Michelle Obama's 2008 convention address AP US election 2016: the race for the White House in pictures Hillary Clinton talks to reporters aboard her new campaign plane on Labour Day, 5 September, her first 'press conference' since 2015 (Getty Images) US election 2016: the race for the White House in pictures Donald Trump held a joint press conference with Mexican leader Enrique Pena Nieto in Mexico City in August, hours before reiterating his harsh immigration plans at a campaign rally in Arizona Reuters US election 2016: the race for the White House in pictures Bernie Sanders officially endorsed Hillary Clinton, saying his progressive vision for ‘a transformed America’ would be ’best served by the defeat of Donald Trump’ Reuters US election 2016: the race for the White House in pictures Khizr and Gazala Khan appeared at the DNC to slam Trump for his stance on Muslim immigration, citing the case of their son Humayun Khan, who was killed in combat while serving as a Captain in the US Army in Iraq US election 2016: the race for the White House in pictures Libertarian candidate Gary Johnson is doing better in polls than any third party candidate since Ross Perot, 20 years ago Nicholas Kamm/AFP/Getty US election 2016: the race for the White House in pictures Green Party candidate Jill Stein (centre) marches with supporters in Colorado AP US election 2016: the race for the White House in pictures Hillary Clinton and Virginia Senator Tim Kaine at a rally in Kaine's home state in July, days before Ms Clinton tapped him to be her running mate Getty US election 2016: the race for the White House in pictures Trump on the campaign trail with his vice presidential pick, Indiana governor Mike Pence AP US election 2016: the race for the White House in pictures Former Ukip leader Nigel Farage appears at a Trump rally in Mississippi in August, where he told the crowd that he 'wouldn't vote for Hillary Clinton if you paid me'.

Analysts say details are unlikely to be released as counterintelligence investigations rarely end with criminal charges and court proceedings, although House and Senate committees have been holding public hearings and could publicise their findings.

Last week, congressional officials said Michael Flynn, Mr Trump's first national security adviser, appeared to violate federal law when he failed to seek permission or inform the US government about accepting tens of thousands of dollars from Russian organisations after a trip there in 2015.

Mr Comey will be testifying publicly before the Senate Judiciary Committee, and is due to speak behind closed doors to a House committee on Thursday, after claiming he wants to be “transparent” when it comes to discussing foreign meddling in American politics.

Sally Yates, the former Acting Attorney General who was dismissed for refusing to back Mr Trump's attempted "Muslim ban", is due to testify before the Senate panel next week.

She will say she warned the White House over Mr Flynn's discussions with the Russian ambassador three weeks before he was fired, CNN reported.

The allegations are among several issues driving worsening relations between Russia and the West, as well as the wars in Syria and Ukraine.

Mr Putin dismissed accusations of aiding Mr Trump’s campaign as unproven “rumours” used for internal politics during a tense press conference with Angela Merkel on Tuesday.

“We never interfere in other countries’ politics and we want no one to meddle in ours,” the Russian President said.

“Unfortunately, we have seen the opposite happening for years. We have seen attempts to influence political processes in Russia through the so-called NGOs and directly.

“Realising the futility of such efforts, it has never occurred to us to interfere."