Donald Trump won the Arizona Republican primary on Tuesday, after promising to build the state a "beautiful" border wall and gaining support of its virulently anti-unauthorized immigration sheriff.

Trump defeated Sen. Ted Cruz of Texas and Ohio Gov. John Kasich. Trump's victory in Arizona, a winner-take-all primary state, puts him 58 delegates closer to the 1,237 needed to secure the nomination for president.

Trump's campaigning in Arizona, like elsewhere in the country, was marked by violence and protests at rallies. Protesters blocked the road to one of his events on Saturday. Later that day, a man punched and kicked a protester at a Trump rally.

Trump consistently led in the polls in Arizona since declaring his bid last summer. He made border security key to his message -- an issue that hits closer to home for Arizonans than it does for the many GOP voters who applauded the message far from the U.S. border with Mexico. Trump said he would build a wall along the southwest border of the U.S. and deport all undocumented immigrants, although the "good ones" could come back.

His message is one that resonated with Sheriff Joe Arpaio of Maricopa County, Arizona, a law enforcement official infamous for his “tent city” jail, where inmates are intentionally humiliated, as well as his controversial raid tactics and rhetoric against undocumented immigrants. Arpaio endorsed Trump in January.

Former Arizona Gov. Jan Brewer (R), who signed the state's 2010 law aimed at driving out undocumented people, also endorsed Trump.

Arizona's GOP primary is open only to registered Republicans, making it impossible for registered independents or Democrats to cast a ballot. Some speculated that would create an opening for Cruz, who would be less likely than Trump to attract the votes of people outside the Republican Party.

Although the immigration messages of Trump and Cruz were apparently successful in the primary, the state has also given victories to politicians with a more moderate stance on the issue. Its current U.S. senators, Republicans John McCain and Jeff Flake, made up half of the GOP side of the "gang of eight" that drafted a comprehensive immigration bill that passed the Senate in 2013.

Neither senator is a fan of Trump, although neither has gone so far as to say he would not support Trump in a general election. Flake visited a mosque in December, after Trump called for a temporary ban on Muslims entering the country, and recently said "it would be very difficult to support Donald Trump."

"It's a concern to have Trump on the top of the ticket. It's a concern for anyone on the ballot," Flake said earlier this month, according to CNN. "Some of us feel we have a responsibility to speak out when he makes outlandish, crazy statements like the Muslim ban or a number of others."

McCain, the 2008 Republican presidential nominee, said earlier this month that he shares "the concerns about Donald Trump" voiced by 2012 nominee Mitt Romney, particularly on national security. McCain has said he would not endorse a candidate in the Republican primary.

"I want Republican voters to pay close attention to what our party's most respected and knowledgeable leaders and national security experts are saying about Mr. Trump, and to think long and hard about who they want to be our next Commander-in-Chief and leader of the free world," he said in a statement in early May.

Editor's note: Donald Trump regularly incites political violence and is a serial liar, rampant xenophobe, racist, misogynist and birther who has repeatedly pledged to ban all Muslims -- 1.6 billion members of an entire religion -- from entering the U.S.