U.S. House Speaker Paul Ryan on Tuesday defeated a long-shot Republican primary challenger who had been praised by Donald Trump.

Ryan beat businessman Paul Nehlen in Tuesday's Wisconsin primary. Nehlen had been courting Trump supporters and won praise from the Republican presidential nominee last week. But Trump endorsed Ryan days later.

"I'm humbled and honoured that Wisconsinites in the 1st Congressional District support my efforts to keep fighting on their behalf," Ryan said in a statement to The Associated Press. Ryan said he and his wife, Janna, were grateful and thankful for the support.

Ryan had largely ignored Nehlen in what had been a sleepy primary before Trump thanked Nehlen on Twitter for his comments defending Trump. Nehlen won the backing of some prominent conservative figures, including former Alaska governor Sarah Palin, but it wasn't enough to overcome Ryan's popularity in his southeastern Wisconsin district.

Ryan was first elected in 1998, and this is his first re-election win since becoming Speaker last fall.

Massive advantage

Ryan went into the primary with massive advantages in name recognition and money. He had out-raised the unknown Nehlen by a 17 to 1 ratio through the latest reporting period. Ryan was largely ignoring his opponent and was expected to win easily.

Trump changed all that the week before the primary, when he tweeted thanks to Nehlen for support while Trump was being vilified for remarks about the Muslim American parents of a U.S. soldier slain in Iraq. Trump also said he wasn't ready to endorse Ryan, who had joined in that criticism.

Trump shifted course a few days later under heavy pressure from Republican leadership, but by then Nehlen had gotten a burst of national publicity.

Ryan responded with a blitz of radio appearances and added a pair of campaign stops the day before the election, determined to avoid the fate of House majority leader Eric Cantor, when the Virginia Republican lost a primary to a little-known Tea Party challenger.

Ryan had other advantages, including widespread popularity in the district where he was first elected in 1998. Ryan had also worked hard to maintain those home ties, travelling back to Janesville, Wis., as much as possible to be with his wife and three children.