Sen. Ted Cruz (R-Tex.), left, and businessman Donald Trump talk during a rally against the Iran nuclear deal on Capitol Hill in September. They have been unusual allies in the 2016 presidential race. (Pete Marovich/Bloomberg)

Businessman Donald Trump and the man on his heels in the polls, Sen. Ted Cruz, have spent much of the year in an odd political bromance, lavishing each other with praise, appearing at a rally together or just saying nothing at all.

Friday, however, all signs pointed to a rocky patch in their relationship — one that Cruz initially moved quickly to shore up but Trump later deepened with a rash of insults at an Iowa rally.

The spat this week began after audio emerged from a Cruz fundraiser where the candidate raised doubts about Trump’s “judgment.” Trump fired back Friday morning with a series of tweeted taunts, breaking a long-held detente between the two.

“Looks like @tedcruz is getting ready to attack,” Trump wrote. “I am leading by so much he must. I hope so, he will fall like all others. Will be easy!”

The shift in Trump’s approach to Cruz is significant: Cruz is the only candidate who has been largely spared from Trump’s ­insult-heavy attacks, and the Texas Republican has gone to great lengths to play nice with the Manhattan billionaire.

Cruz, right, greets Trump onstage as they address at a September tea party rally. Both stand to lose more than they would gain by attacking each other. (Jonathan Ernst/Reuters)

Cruz moved quickly Friday to smooth things over by taking aim at one of his favorite targets: the Republican elite.

“The Establishment’s only hope: Trump & me in a cage match. Sorry to disappoint — @realDonaldTrump is terrific. #DealWithIt,” Cruz tweeted.

Trump retweeted the message later in the afternoon.

But Friday night, Trump was done holding back the insults. At a rally in Des Moines, he repeatedly slammed Cruz for not supporting continued subsidies for ethanol, a major business in Iowa, and suggested that Cruz took this stand because of his ties to major oil companies based in Texas. Trump also made a vague reference to Cuba, the home country of Cruz’s father, and tied it to evangelical voters, who play a major role in the Iowa caucuses. Cruz has assiduously courted evangelical voters throughout his campaign.

“We’re doing really well with the evangelicals,” Trump said. “And, by the way — and again, I do like Ted Cruz — but not a lot of evangelicals come out of Cuba, in all fairness. It’s true. Not a lot come out. But I like him nevertheless. But I think we’re going to do great, and we are doing great with evangelicals.”

Cruz’s campaign declined to comment. But a prominent Iowa surrogate for Cruz, radio host Steve Deace, said on Facebook that the senator has locked down support in the state and there is no need to “go to war” with Trump.

Trump also described super PACs as “no good” and noted that he doesn’t have a super PAC officially supporting his candidacy. Cruz has a constellation of super PACs that have raised nearly $38 million since the beginning of the campaign.

Cruz’s campaign sees a massive benefit to having Trump in the race. The senator and his aides believe that Trump has changed the tenor of the contest to Cruz’s advantage by highlighting issues such as distrust of Washington and immigration. Cruz is casting himself as an insurgent insider looking to take down what he calls the “Washington cartel” from within.

Both stand to lose more than they would gain from attacking each other, since they appeal to many of the same sorts of voters, especially in Iowa, where Cruz has been surging. Tearing each other down could aid some of their rivals, such as Sen. Marco Rubio (R-Fla.). Trump has never hesitated to go after opponents who threaten him in any way, but he is often calculated in doing so — using only as much ammunition as needed. Even though Trump hit Cruz on Friday, he did so with friendly caveats, repeatedly calling the senator a “nice guy.”

Cruz’s campaign has seen momentum in the past few weeks with a rise in the polls, including one this week that showed him taking the lead in Iowa. He also secured the endorsement of an influential Iowa evangelical leader Thursday.

“No one else has been able to deal with Donald Trump or break through, and we’ve done both,” said one Cruz aide, who spoke on the condition of anonymity to discuss internal campaign assessments.

But even before Friday’s hits, Cruz’s campaign was preparing for the possibility that Trump would pounce if Cruz started to seriously threaten his ­front-runner status. The campaign has been gaming out ways Trump could strike, according to the aide, and will respond only on issues of substance, not petty attacks.

“We have a pretty good inventory of lines of attack. We have done our homework. There’s nothing that they will hit us with that will surprise us,” the Cruz aide said.

At a public appearance in Missouri on Monday, Cruz’s wife talked about one possible avenue of attack. A woman asked Heidi Cruz to explain how her husband, who was born in Canada, is eligible to be president. Heidi Cruz said legal scholars have determined that he is a natural-born citizen, and thus able to be president, because his mother was born in the United States. She also noted that both Sen. John McCain (R-Ariz.) and the late Michigan governor George Romney were born outside the United States to American parents and were eligible to run for the White House.

Even so, she said, “Trump will probably attack him on it.”

Trump has made an issue of Cruz’s Canadian birth in the past, saying it could be a “problem” and a “hurdle.” But in September, Trump said that Cruz’s eligibility had been “checked out by every attorney” and that he was “in fine shape.”

Trump also has long questioned President Obama’s origins, alleging that he was born in Kenya rather than in his actual birthplace, Hawaii.

Cruz has drafted close to Trump in hopes of inheriting supporters should the real estate mogul drop out of the race or plummet in the polls.

There is also the fact that candidates who have jabbed at Trump have not done well, causing Cruz to repeatedly express his “love” and admiration for the GOP front-runner. He has done much the same with Ben Carson, the retired neurosurgeon who has been sliding in the polls but maintains high favorability ratings.

“My approach, much to the frustration of the media, has been to bear-hug both of them and smother them with love,” Cruz said at a New York fundraiser, according to an audio file of his remarks obtained by the New York Times. “I believe that gravity will bring both of those campaigns down. I think the lion’s share of their supporters come to us.”

Discussing Trump and Carson, Cruz also wondered about those men “having their finger on the button.”

“Now that’s a question of strength, but it’s also a question of judgment, and I think that is a question that is a challenging question for both of them,” he said at the fundraiser.

Cruz has many times on the stump painted the contest as one of judgment, but this is the first time he has specifically cited Carson and Trump in that context.

The relationship between Cruz and Trump has been chummy, almost strangely so for two men vying to be commander in chief. Cruz has trained most of his fire on Rubio, who in recent weeks has been jockeying with Cruz for second place in many polls.

Cruz and Trump have met in the past, including a 45-minute sit-down at Trump Tower in July. There, the senator invited Trump to visit the U.S.-Mexico border, a trip Cruz didn’t end up making because of Senate votes. In September, Cruz asked Trump to headline a Capitol Hill rally against the Iran nuclear deal.

Cruz also defended Trump after the businessman made controversial remarks about Mexican immigrants, with Cruz calling Trump “bold” and “brash.”

People close to Trump’s campaign have said the relationship has been driven by Cruz.

And some in Cruz’s orbit aren’t particularly worried about the threat from Trump.

Cruz “can articulate a response and a message . . . that can be a response to a negative hit without having to attack who makes the assumption and the assertion,” said Louie Hunter, one of the senator’s state co-chairs in Georgia.

Earlier this week, Cruz rejected Trump’s proposal to bar most Muslims from traveling to the United States, but he did not blast it in the way other candidates did. Instead, he offered personal praise.

“I disagree with that proposal,” he said. “I like Donald Trump.”

Johnson reported from Des Moines.