FBI Director James Comey on Monday confirmed for the first time that the bureau is investigating possible ties between Republican Donald Trump's presidential campaign and Russia as Moscow sought to influence the 2016 U.S. election.

Comey and Admiral Mike Rogers, the director of the National Security Agency, made clear that their investigation of Moscow and November's U.S. elections could last for months.

Appearing before a congressional panel, Comey also publicly challenged Trump's claim that former President Barack Obama wiretapped his 2016 campaign headquarters in Manhattan's Trump Tower.

The two officials spent 5-1/2 hours before the House of Representatives Intelligence Committee in testimony marked by starkly partisan divides between the panel's majority Republicans and Democrats.

Comey refused to back away from his claim that Russian President Vladimir Putin did not simply want Democratic presidential candidate Hillary Clinton to lose the election; he wanted Donald Trump to win.

Trump created a controversy in early March when he tweeted without giving evidence that Obama had wiretapped his campaign while the businessman competed against Clinton.

"With respect to the president's tweets about alleged wiretapping directed at him by the prior administration, I have no information that supports those tweets," Comey said.

Leon Panetta, a former U.S. defense secretary and CIA director during the Obama administration, said in an interview that Trump should "acknowledge that he made a mistake, apologise to President Obama."

The committee is one of several in the U.S. Congress investigating whether Russia tried to influence the election, mostly by hacking Democratic operatives' emails and releasing embarrassing information. Russia denies the allegations.

Comey confirmed the FBI has been investigating since July possible Russian efforts to interfere in the election, including any cooperation between Trump's campaign and Moscow. He said that while the Russian government wanted to hurt Clinton's campaign and help Trump's, intelligence agencies made no judgement on whether the efforts influenced the outcome.

Comey gave no details of the classified investigation and said the fact that it exists does not mean charges would be filed.

U.S. intelligence agencies have concluded that Russia tried to help Trump by hacking leading Democrats.


PUTIN'S PREFERENCE

"I think that was a fairly easy judgement for the (intelligence) community," he said. "Putin hated Secretary Clinton so much that the flip side of that coin was he had a clear preference for the person running against the person he hated so much."

Asked about Comey, White House spokesman Sean Spicer read a series of quotes from officials - some from the Obama administration - who have said they have seen no signs of collusion between Trump's campaign and Russia.

In a tweet before the hearing, Trump wrote: "The Democrats made up and pushed the Russian story as an excuse for running a

terrible campaign."

Spicer said he was unaware of any White House official being under investigation by the FBI.

Trump has frequently urged better relations with Russia, which has been at odds with the United States over Ukraine and the Syrian civil war.

Representative Adam Schiff, the top Democrat on the intelligence committee, detailed activities by Trump associates with ties to Russia, including former campaign manager Paul Manafort and Michael Flynn, who was forced out as Trump's national security adviser after talking to the Russian ambassador and then misrepresenting the conversation to Vice President Mike Pence.

"Is it possible that all of these events and reports are completely unrelated and nothing more than an entirely unhappy coincidence? Yes, it is possible," Schiff said. "But it is also possible, maybe more than possible, that they are not coincidental, not disconnected and not unrelated."


NO 'PHYSICAL' WIRETAP

Trump's March 4 tweet about wiretapping pulled attention away from the claims of Russian election interference. He issued his tweet two days after Attorney General Jeff Sessions, who met with Russia's U.S. ambassador at least twice last year, said he would recuse himself from any investigation of the matter.

The White House has contended in recent days that Trump's claim of wiretapping referred to general surveillance of the campaign. The White House has not provided evidence of surveillance of any kind.

"Let me be clear: We know there was not a physical wiretap on Trump Tower. However, it's still possible that other surveillance activities were used against President Trump and his associates," said Representative Devin Nunes, the committee's Republican chairman.

Last week, Trump's spokesman cited a media report that British intelligence was behind the surveillance, prompting ridicule in London.

Rogers said the allegation had strained relations with London. "I think it clearly frustrates a key ally of ours," Rogers said.

Comey warned that Russia would attempt to influence the next U.S. presidential election in 2020 and perhaps congressional elections next year.

"They'll be back in 2020. They may be back in 2018. And one of the lessons they may draw from this is that they were successful because they introduced chaos and division and discord and sowed doubt about the nature of this amazing country of ours and our democratic process," he said.

Clinton's fellow Democrats feel Comey played an inappropriate role in the 2016 presidential contest by issuing a statement shortly before Election Day reviving an investigation of Clinton's use of a private email server. Then, just two days before the election, Comey announced the FBI was sticking by a decision made months earlier that no criminal charges were warranted.