House speaker Paul Ryan, the top U.S. elected Republican, on Tuesday distanced himself from presidential candidate Donald Trump's proposed ban on Muslims from a variety of countries in a further sign of establishment unease with Trump's agenda.

Trump gave his first speech on the Orlando, Florida massacre on Monday, a day after the attack at a gay nightclub that was the deadliest mass shooting in U.S. modern history.

The New York mogul said that if elected on Nov. 8, he would temporarily suspend immigration from areas of the world where there is "a proven history of terrorism." In a subsequent tweet, he said he was referring to "nations tied to Islamic terror."

Ryan, the speaker of the U.S. House of Representatives, was peppered with questions about Trump's proposal at his weekly news conference.

Ryan endorsed Trump, the presumptive Republican presidential nominee, two weeks ago but subsequently blasted him for calling a federal judge biased because of the U.S.-born judge's Mexican heritage.

"I do not think a Muslim ban is in our country's interests," said Ryan, who last year criticized Trump's original proposal for a temporary ban on Muslims entering the United States.

Ryan and like-minded establishment Republicans have struggled to reconcile their desire to unify the party in advance of a tough fight against Democrat Hillary Clinton while at the same time separating themselves from some of the positions and rhetoric of Trump, who defeated 16 rivals to win the presidential nomination battle.

Ryan said "the smarter way to go" would be to have a "security test" for Middle Eastern immigrants to ensure proper security screening. He noted that the House passed legislation to tighten visa restrictions that President Barack Obama signed into law, but that the Senate had blocked another measure that would provide greater security screening.

"This is a war with radical Islam. It's not a war with Islam. Muslims are our partners," Ryan said. "The vast, vast majority of Muslims in this country and around the world are moderate, they're peaceful, they're tolerant. So they are among our best allies, among our best resources, in this fight against radical Islamic terrorism."

Trump has been resolute in demanding tighter immigration policies. The massacre of 49 people at the nightclub by gunman Omar Mateen, 29, whose parents were born in Afghanistan, has prompted the Republican candidate to intensify his rhetoric as he tries to garner support from Americans with deep security fears.

Trump noted that Mateen's parents were born in Afghanistan. Pointing to specific incidents such as the Sept. 11, 2001, attacks, he said threats were posed by people with roots in Pakistan, Saudi Arabia and Somalia.

Trump, who was celebrating his 70th birthday on Tuesday, met at Trump Tower in New York with a host of Republican governors, including Oklahoma's Mary Fallin, who a source close to the campaign says is on Trump's short list to be his vice presidential running mate.

A Republican official said others in the meeting included the governors of Mississippi, Arizona, Arkansas, Nebraska and Tennessee, as well as New Jersey's Chris Christie, a close Trump adviser and former presidential rival.