Republican Senator Jeff Flake visited a mosque in Scottsdale, Arizona, on Friday in an effort to promote unity in the midst of the anti-Muslim rhetoric seen in the wake of recent ISIS-inspired terrorist attacks across the world, and last week’s terror attack in San Bernardino, California.

Flake, who said he had never visited a mosque before, spoke for nearly 10 minutes to the crowd of over 300 attendees, giving what he called “a message of solidarity and appreciation for the contributions of the Muslim American community,” and working to put some distance between himself and the proposal by Republican presidential candidate Donald Trump which would temporarily bar Muslims from entering the United States.

"This was a difficult week in Washington — it wasn't so much the legislative calendar as it was the rhetoric that came forth mostly from the presidential campaign,” Flake said to the congregation. "That is not in keeping with the values and ideals that have made this country the shining city on the hill that it is."

Related: Trump Issues Warning Shot to Cruz After Reported Critique

Flake’s visit came after he took to Twitter earlier this week to criticize Trump’s proposal, saying, “Just when you think @realDonaldTrump can stoop no lower, he does.”

Just when you think @realDonaldTrump can stoop no lower, he does. These views do not reflect serious thought. https://t.co/B4ueLG2ShQ — Jeff Flake (@JeffFlake) December 7, 2015

Trump’s plan has been widely criticized by both Congressional Democrats and Republicans, and many of Trump’s fellow presidential candidates have said they do not support it.

A recent NBC News/Wall Street Journal poll found that 57 percent of Americans oppose Trump’s proposal, and 59 percent of Americans have a favorable view of Muslims.

"It's just the antithesis of all we stand for here in America, and the freedom of religion that we all embrace so much," Flake said of Trump’s proposal. "I don't think that it reflects well on, certainly not on the Republican Party, it doesn't reflect well on us as a country if this were to go."

Related: Poll Shows Voters Split on Trump's Muslim Ban

Flake’s visit to the mosque was well received, with on attendee calling it “a phenomenal moment for us.”

"We're all on the same platform, we all believe in the same message, and we're all combating the same thing, combating extremism," Rheem Khalife Kabbani, who attended Friday’s service, told NBC News.

"To have him here today was really just powerful, very powerful, especially someone from the Republican Party joining our congregation was just a phenomenal moment for us," Meraj Mohiuddin said.

The attack in San Bernardino was carried out by Syed Farook and his wife, Tashfeen Malik. They opened fire on a training session and holiday luncheon attended by county employees on Dec. 2, killing 14 people and wounding 22 others. Farook and Malik were later killed in a shootout with police.

The FBI is treating investigating the attack as an act of terrorism, and said Farook and Malik were radicalized and dedicated to jihad for quite some time, before they met and married.

Related: San Bernardino Shooters Practiced for Attack a Year in Advance

Yaser Ali, who serves as the religious director for the Islamic Center of the North East Valley, said the attack in San Bernardino has left Muslim Americans “scared,” and said that their community alone has raised tens of thousands of dollars for the victims of the attack.

"People are scared, and Muslims are scared, and we recognize that," Ali said. "In fact, we have to be doubly afraid now because of the rise in the backlash and the anti-Muslim sentiment that's rising."

"I know at a time where there is so much hostility and so much adversity, for Senator Flake to be here and to show solidarity and to speak to our community, it's a really powerful moment," Ali said. "It's an uplifting moment at a time of difficult and distress."

At times during his address to the mosque, Flake, who is Mormon and attended the Friday prayer service with his family, tried to be light hearted. "I bet you never thought you'd see a Mormon speak at a mosque," he said.

"I was speaking to my sons, whose responsibility is at our church to set up and take down chairs before and after meeting, they say this wouldn't be too bad," Flake joked, as prayer services in a mosque don’t use chairs or pews.

But Flake struck a serious chord when asked about Trump and the effect his candidacy is having on the country. Flake said there are some indications that some voters may believe Trump’s recent proposal regarding Muslims has gone too far.

"I think Republicans are smart and will come around," Flake said. "I don't believe that Donald Trump will be our nominee. I'm grateful for that."