Arizona Senator Jeff Flake has been caught badmouthing Donald Trump and Roy Moore to a Republican mayor who responded by calling the president an 'idiot'.

At a tax reform event in Arizona on Friday, Flake appeared to forget that he was still wearing his mic when he told Mesa mayor John Giles: 'If we become the party of Roy Moore and Donald Trump, we are toast.'

Giles replied by urging him to run for president himself, saying: 'I'm not throwing smoke at you but you're the guy that could... just for fun.

'Think how much fun it would be just to be the foil and point out what an idiot this guy is.'

The pair had just finished answering questions on the subject and had not yet taken off their microphones.

Scroll down for video

Sen. Jeff Flake was speaking to Mesa Mayor John Giles when he made the comments on Friday night. They were picked up by a local ABC affiliate which was covering the event

Giles, who is also a Republica, replied by urging Flake to run for president and appeared to call the president 'an idiot'

Senator Jeff Flake had just finished speaking the event and had not yet taken off his mic

Sen. Flake's comment was in reference to the growing accusations against Alabama Judge Moore who is running for a seat in the senate.

Nine women have now come forward to accuse Moore of sexual misconduct.

President Trump, who has fought off accusations of his own in the past, has said nothing of the allegations against Moore but has enthusiastically condemned Dem. Sen.

Al Franken over a photograph which showed him groping a female model while she slept. Franken had apologized repeatedly for the image by the time Trump tweeted about him.

A video of Flake and Giles' exchange was captured by ABC News affiliate KNXV.

Moore is running for the seat left by Attorney General Jeff Sessions and has vowed to carry on his campaign despite the growing accusations against him.

Roy Moore, 70, is running for the seat left vacant by Attorney General Jeff Sessions in Alabama. He denies the accusations against him and is being supported by his wife Kayla

President Trump has criticized Dem. Sen. Al Franken, who was also exposed for sexual harassment this week, but has said nothing of the accusations against Moore

His wife Kayla is standing by him and spoke in his defense at a campaign event in Montgomery on Friday where she labeled him a 'gentleman'.

Flake is a vocal critic of the president.

Last month, he announced to the Senate floor that he would not seek reelection because of the state of the party.

He laid the blame for it squarely with Trump who he said was at fault for creating an 'alarming' and 'dangerous' state of affairs.

Sen. Flake has been merciless in his criticism of Moore since nine women emerged to accuse him of sexual misconduct over the last week

He has reserved the same harsh tone for Dem. Sen. Al Franken who this week apologized to a woman who he groped and allegedly forcibly kissed in 2006

Since the accusations against Moore emerged last week, he has been vociferous in his criticism of him and said he would rush to vote for a Democrat instead of him.

'Just be clear, if the choice is between Roy Moore and a Democrat, I would run to the polling place to vote for the Democrat,' he said this week.

He has also been vocal in his criticism of Franken whose behavior he said 'disgusted' him.

The lesser-known Giles has stood against some of the president's proposed policies in the past.

In August, he joined a larger group of mayors who urged Trump not to do away with Obama's DACA 'Dreamers' program. Giles has been the mayor of Mesa since 2014.

Neither politician has commented on the hot-mic remarks.