Photo

For a moment, it seemed Donald J. Trump thought he had gone too far. The moment passed.

Shortly after publishing, then deleting, a menacing Twitter post about the wife of Senator Ted Cruz, Mr. Trump quickly corrected himself late Tuesday — by adding more colorful language and punctuation to his threat.

“Lyin’ Ted Cruz just used a picture of Melania from G.Q. shoot in his ad,” Mr. Trump wrote in the slightly revised message. “Be careful, Lyin’ Ted, or I will spill the beans on your wife!”

Mr. Trump appeared to be referring to a recent ad from the “super PAC” Make America Awesome, which showed Mr. Trump’s wife Melania, a former model, posing nude. The ad, which was targeted to Mormon voters, has no ties to Mr. Cruz’s campaign.

But the text beside an image of Mrs. Trump reads: “Meet Melania Trump. Your next first lady. Or, you could support Ted Cruz on Tuesday.”

Less than 30 minutes after Mr. Trump’s post, as primary results trickled in, Mr. Cruz responded.

“Pic of your wife not from us,” he wrote. “Donald, if you try to attack Heidi, you’re more of a coward than I thought. #classless.”

It was unclear what Mr. Trump had in mind concerning Heidi Cruz, a businesswoman who worked in the administration of George W. Bush. Mrs. Cruz has spoken in the past about a trying moment in her life and marriage in 2005, when she suffered through what Mr. Cruz has described as a “period of depression” after moving to Texas from Washington to be closer to her husband.

Mr. Trump’s cryptic warning continued a pattern of mischief-making on Twitter. In the past, Mr. Cruz has often deflected some of Mr. Trump’s more outlandish attacks by posting playful pop culture videos, often from the 1980s.

More recently, Mr. Cruz has teased his rival by calling him “#DuckingDonald” over Mr. Trump’s decision to bypass presidential debates.

There was a time when relations were less strained. In December, months into his long embrace of Mr. Trump on the campaign trail, Mr. Cruz still appeared eager to praise.

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