What does the Republican nominee for president do when he can't sleep?
Awake at 3 a.m. ET, Donald Trump picked up his phone and began tweeting about "made up lies" in the media.
Just two hours later, he opened up Twitter again and quickly went from venting to slandering a former beauty queen -- shaming her for a sex tape that does not exist.
Trump's conduct since the first debate has been astonishing for a major party nominee just 39 days away from the election. Instead of zeroing in on his strongest points from Monday night on jobs and trade, he's cited fake polls, resurfaced Bill Clinton's marital scandals from the 1990s, floated a conspiracy theory about Google searches, and attacked 1996's Miss Universe.
And after Hillary Clinton raised allegations that Trump called 1996 Miss Universe Alicia Machado "Miss Piggy" and "Miss Housekeeping," Trump has kept that controversy alive by refusing to apologize, instead seeking to discredit Machado and justify his apparent comments and similar ones he made in interviews at the time.
The overnight tweeting spree once again brought into focus Trump's apparent unwillingness or inability to back away from a fight, regardless of who is attacking him. It's a habit that serves to keep the attention away from his core campaign message and also emphasizes Hillary Clinton's argument that Trump lacks the temperament to be president.
"What kind of man stays up all night to smear a woman with lies and conspiracy theories," Clinton's campaign tweeted Friday about the incident.
It was reminiscent of Trump's rough and tumble month of August when he skirted numerous controversies and refused to back down after the Khans, parents of a Muslim US soldier who died in Iraq, criticized him for his Islamophobic rhetoric and policies.
Even as his top advisers urged him to abandon his feud with the Khans, Trump escalated it, suggesting Ghazala Khan, the mother, stood silently alongside her husband at the Democratic National Convention because she was subservient to her husband and comparing his own sacrifices to the family's loss of their son.
It's also become clear that Trump's supporters are less than thrilled with his decision to keep the Machado controversy alive.
Kellyanne Conway, the billionaire's campaign manager, said Thursday on "The View" that she reprimanded Trump for his comments on "Fox and Friends."
And Trump supporter Kayleigh McEnany, a CNN political commentator, rebuked Trump Friday morning for his overnight tweeting, saying, "I don't think Donald Trump needs to be doing that."
The controversy started when Clinton brought up Trump's comments and treatment of Machado at Monday's presidential debate. The next morning, Trump doubled down.
"You know, she gained a massive amount of weight (after winning Miss Universe) and it was a real problem. We had a real problem," Trump said on "Fox and Friends" the morning after the debate.
He defended himself similarly in an interview the next day with Fox News' Bill O'Reilly.
As Machado did the media rounds and the Clinton campaign continued to attack Trump over his treatment of Machado, Trump apparently couldn't shake the hits. And that's when he pulled up Twitter in the wee hours of Friday morning, and began firing off.
"Wow, Crooked Hillary was duped and used by my worst Miss U. Hillary floated her as an 'angel' without checking her past, which is terrible!" he tweeted.
"Using Alicia M in the debate as a paragon of virture just shows taht Crooked Hillary suffers from BAD JUDGEMENT! Hillary was set up by a con," he continued at 5:19 a.m.
And finally, "Did Crooked Hillary help disgusting (check out sex tape and past) Alicia M become a U.S. citizen so she could use her in debate?"
Machado's past has come under intense scrutiny in recent days, including accusations from Trump's surrogates that she drove a getaway car from a murder scene in Venezuela in 1998, to which Machado replied on CNN this week that "I have my past" and that she is "no saint girl."
"He can say whatever he wants to say. I don't care. You know, I have my past, of course everybody has a past. And I'm no saint girl," Machado told CNN's Anderson Cooper Tuesday on "AC360." "But that is not the point now ... (Trump) was really rude with me, he tried to destroy my self esteem. And now I'm a voice in the Latin community. I'm in a great moment in my life and I have a very clear life. And I can show my taxes."
Tabloids and several conservative media outlets have also falsely claimed Machado starred in a sex tape. No such sex tape exists.
Supporters of the Republican nominee have argued since Trump's roller coaster month of August that he has evolved as a candidate: he shook up his campaign leadership and has faithfully stuck to delivering rally speeches from a teleprompter, minimizing the number of controversies he can stoke.
But late at night, with his campaign staff far from his side, Trump was free to follow his gut. And his gut told him to punch back at a former Miss Universe whom he allegedly once called "Miss Piggy" after she gained weight by calling her disgusting for starring in a non-existent sex tape.
And so that's what he did.
By Jeremy Diamond, CNN