In a Republican primary race already full of insults and mud-slinging, the battle between front-runner Donald Trump and Sen. Ted Cruz got even uglier Wednesday -- as the candidates started by clashing over attacks on each other's wives, then went Hollywood.

The Texas senator came out swinging Wednesday, telling CNN, “If Donald wants to get in a character fight he’s better off sticking with me, because Heidi is way out of his league.”

Then the rivals got into a Twitter exchange that by late afternoon had Trump accusing Cruz of stealing the line from Michael Douglas as the star of the 1995 movie “The President.”

“Lyin’ Ted Cruz steals foreign policy from me, and lines from Michael Douglas -- just another dishonest politician,” Trump tweeted.

The Douglas character says in the movie, referring to his girlfriend, "If you want a character debate Bob, you better stick with me because Sydney Ellen Waid is way out of your league."

The social media battle took another turn late Wednesday after Trump retweeted a picture of his wife alongside an unflattering image of Heidi Cruz. Ted Cruz responded by tweeting, "Donald, real men don't attack women. Your wife is lovely, and Heidi is the love of my life."

Cruz was originally responding to threats made by Trump after a super PAC produced a Facebook ad showing Trump’s wife, Melania, posing nude.

Trump took to Twitter Tuesday – making a not-so-thinly veiled threat regarding Cruz’s wife Heidi Cruz.

The real estate mogul tweeted that the Texas senator should "be careful" or he would "spill the beans on your wife.”

"Lyin' Ted Cruz just used a picture of Melania from a G.Q. shoot in his ad. Be careful, Lyin' Ted, or I will spill the beans on your wife!" Trump tweeted Tuesday evening, just minutes before polls closed in Arizona. Trump tweeted and deleted a similar version of the tweet about 10 minutes earlier.

Trump appeared to be referring to a Facebook advertisement targeted to Mormons that shows Trump's wife, Melania, posing nude. That ad was produced by an anti-Trump super PAC, Make America Awesome, which has no known connection to the Cruz campaign.

Cruz responded on Twitter by saying that the ad was not from him and if he went after his wife, then Trump is a "coward."

"Pic of your wife not from us. Donald, if you try to attack Heidi, you're more of a coward than I thought. #classless," Cruz tweeted.

On Wednesday, Cruz reiterated he had no affiliation with the super PAC but added that Trump’s bad behavior may have been the result of a “bad night in Utah.”

Cruz won the Republican contest in Utah Tuesday, capturing more than 50 percent of the vote and all 40 of the state’s delegates. Trump won the night's Arizona primary.

"When Donald gets scared, when he gets angry, when he gets threatened ... So last night Donald threatened my wife, he went directly after my wife,” Cruz said.

Heidi Cruz is a senior executive for Goldman Sachs, and took a leave from work in order to help her husband's campaign. She has become one of the campaign's most accomplished fundraisers.