Sen. Ted Cruz (R., Texas) was declared the winner of the Republican primary in Wisconsin Tuesday, dealing a setback to business mogul Donald Trump.

NBC News and Fox News called the race in favor of Cruz Tuesday night about a half hour after polls closed at 9 P.M. EST. Cruz captured 48 percent of the vote, with Trump and Ohio Gov. John Kasich following behind with 35 percent and 14 percent, respectively.

Cruz appeared to pivot to the general election during his victory speech from Milwaukee Tuesday evening, labeling it a "bad night" for Hillary Clinton, who lost to competitor Sen. Bernie Sanders (I., Vt.) in the Democratic primary.

Cruz said that his campaign is "uniting the Republican Party," pointing to the five endorsements he has received from former fellow candidates.

"Tonight, Wisconsin has lit a candle guiding the way forward," Cruz told the crowd. "Tonight, we once again have hope for the future."

"Let me just say: Hillary, get ready. Here we come," Cruz said, concluding his remarks.

Ahead of Tuesday’s voting, Cruz maintained a slight lead over Trump, according to an average of polls provided by Real Clear Politics. The Texas senator held 39 percent of the vote to Trump’s 35 percent. Kasich followed further behind with 20 percent.

Cruz nabbed an endorsement from Wisconsin Gov. Scott Walker, once himself a 2016 presidential candidate, a week before state voters headed to the polls.

While surveys still show Trump as the national frontrunner, the business mogul has been under fire in recent days for implying that women who get abortions should be punished. He was forced to walk back the statement, which he made during a MSNBC town hall last week, in the wake of outcry.

Trump has also been scrutinized recently for standing by his campaign manager, Corey Lewandowski, after the staffer was charged with misdemeanor battery for aggressively handling a reporter during a Trump news conference in Florida last month. Trump has enlisted his wife, Melania, to accompany him to campaign events amid his declining support among female voters.

A victory for Cruz in Wisconsin will likely increase speculation surrounding the prospect of a contested convention in July, which could deliver the nomination to a Republican other than Trump.

Many party elites, including 2012 GOP presidential nominee Mitt Romney, have vocally opposed Trump’s unconventional candidacy.

While Trump led the field in delegates going into Tuesday’s voting in Wisconsin, Cruz has also won a number of crucial states, including Iowa, the first state to caucus, and Texas, his home state. Kasich, in contrast, has recorded a single win, his home state of Ohio.

Forty-two delegates were up for grabs in the GOP primary in Wisconsin, a winner-take-most state. Republicans will turn next to the crucial primary contest in New York, which will take place on April 19.