As Elon Musk became one of Donald Trump’s closest allies last year, leading raucous rallies and donating about $275 million to help him win the presidency, he was also using drugs far more intensely than previously known, according to people familiar with his activities.

Musk’s drug consumption went well beyond occasional use. He told people he was taking so much ketamine, a powerful anesthetic, that it was affecting his bladder, a known effect of chronic use. He took Ecstasy and psychedelic mushrooms. And he traveled with a daily medication box that held about 20 pills, including ones with the markings of the stimulant Adderall, according to a photo of the box and people who have seen it.

It is unclear whether Musk, 53, was taking drugs when he became a fixture at the White House this year and was handed the power to slash the federal bureaucracy. But he has exhibited erratic behavior, insulting Cabinet members, gesturing like a Nazi and garbling his answers in a staged interview.

At the same time, Musk’s family life has grown increasingly tumultuous as he has negotiated overlapping romantic relationships and private legal battles involving his growing brood of children, according to documents and interviews.

On Wednesday evening, Musk announced that he was ending his stint with the government, after lamenting how much time he had spent on politics instead of his businesses.

Musk and his lawyer did not respond to requests for comment this past week about his drug use and personal life. He has previously said he was prescribed ketamine for depression, taking it about every two weeks. And he told his biographer, “I really don’t like doing illegal drugs.”

At a news conference with Trump on Friday afternoon, Musk was asked about The New York Times’ coverage. He questioned the newspaper’s credibility and told the reporter to “move on.” That evening, Trump told reporters outside Air Force One that he was not aware of regular drug use by Musk. “I’m not troubled by anything with Elon,” he said. “I think he’s fantastic.”

As a large government contractor, Musk’s aerospace firm, SpaceX, must maintain a drug-free workforce and administers random drug tests to its employees. But Musk has received advance warning of the tests, according to people close to the process. SpaceX did not respond to questions about those warnings.

Musk, who joined the president’s inner circle after making a vast fortune on cars, satellites and rocket ships, has long been known for grandiose statements and a mercurial personality. Supporters see him as an eccentric genius whose slash-and-burn management style is key to his success.

But last year, as he jumped into the political arena, some people who knew him worried about his frequent drug use, mood swings and fixation on having more children. This account of his behavior is based on private messages obtained by the Times as well as interviews with more than a dozen people who have known or worked with him.

This year, some of his longtime friends have renounced him, pointing to some of his public conduct.

“Elon has pushed the boundaries of his bad behavior more and more,” said Philip Low, a neuroscientist and onetime friend of Musk’s who criticized him for his Nazi-like gesture at a rally.

And some women are challenging Musk for control of their children.

One of his former partners, Claire Boucher, the musician known as Grimes, has been fighting with Musk over their 5-year-old son, known as X. Musk is extremely attached to the boy, taking him to the Oval Office and high-profile gatherings that are broadcast around the world.

Boucher has privately complained that the appearances violate a custody settlement in which she and Musk agreed to try to keep their children out of the public eye, according to people familiar with her concerns and the provision, which has not been previously reported. She has told people that she worries about the boy’s safety, and that frequent travel and sleep deprivation are harming his health.

Another mother, the right-leaning writer Ashley St. Clair, revealed in February that she had a secret relationship with Musk and had given birth to his 14th known child. Musk offered her a large settlement to keep his paternity concealed, but she refused. He sought a gag order in New York to force St. Clair to stop speaking publicly, she said in an interview.

A ketamine habit

Musk has described some of his mental health issues in interviews and on social media, saying in one post that he has felt “great highs, terrible lows and unrelenting stress.” He has denounced traditional therapy and antidepressants.

He plays video games for hours on end. He struggles with binge eating, according to people familiar with his habits, and takes weight-loss medication. And he posts day and night on his social media platform, X.

Musk has a history of recreational drug use, The Wall Street Journal reported last year. Some board members at Tesla, his electric vehicle company, have worried about his use of drugs, including Ambien, a sleep medication.

In an interview in March 2024, journalist Don Lemon pressed him on his drug use. Musk said he took only “a small amount” of ketamine, about once every two weeks, as a prescribed treatment for negative moods.

“If you’ve used too much ketamine, you can’t really get work done, and I have a lot of work,” he said.

He had actually developed a far more serious habit, the Times found.

Musk had been using ketamine often, sometimes daily, and mixing it with other drugs, according to people familiar with his consumption. The line between medical use and recreation was blurry, troubling some people close to him.

He also took Ecstasy and psychedelic mushrooms at private gatherings across the United States and in at least one other country, according to those who attended the events.

The Food and Drug Administration has formally approved the use of ketamine only as an anesthetic in medical procedures. Doctors with a special license may prescribe it for psychiatric disorders like depression. But the agency has warned about its risks, which came into sharp relief after the death of actor Matthew Perry. The drug has psychedelic properties and can cause dissociation from reality. Chronic use can lead to addiction and problems with bladder pain and control.

By the spring of last year, Musk was ramping up criticism of President Joe Biden, particularly his policies on illegal immigration and diversity initiatives.

Musk was also facing federal investigations into his businesses. Regulators were looking into crashes of Tesla’s self-driving cars and allegations of racism at its factories, among other complaints.

“There are at least half a dozen initiatives of significance to take me down,” he wrote in a text message to someone close to him in May 2024. “The (Joe) Biden administration views me as the No. 2 threat after Trump.”

“I can’t be president, but I can help Trump defeat Biden and I will,” he added.

He publicly endorsed Trump in July.

Around that time, Musk told people that his ketamine use was causing bladder issues, said people familiar with the conversations.

On Oct. 5, he appeared with Trump at a rally for the first time, bouncing up and down around the candidate. That evening, Musk shared his excitement with a person close to him. “I’m feeling more optimistic after tonight,” he wrote in a text message. “Tomorrow we unleash the anomaly in the matrix.”

“This is not something on the chessboard, so they will be quite surprised,” Musk added about an hour later. “ ‘Lasers’ from space.”

After Trump won, Musk rented a cottage at Mar-a-Lago, the president-elect’s Florida resort, to assist with the transition. Musk attended personnel meetings and sat in on phone calls with foreign leaders. And he crafted plans to overhaul the federal government under the new Department of Government Efficiency.

Family secrets

Musk has also been juggling the messy consequences of his efforts to produce more babies.

By 2022, Musk, who has married and divorced three times, had fathered six children in his first marriage (including one who died in infancy), as well as two with Boucher. She told people she believed they were in a monogamous relationship and building a family together.

But while a surrogate was pregnant with their third child, Boucher was furious to discover that Musk had recently fathered twins with Shivon Zilis, an executive at his brain implant company, Neuralink, according to people familiar with the situation.

Musk was by then sounding an alarm that the world’s declining birthrates would lead to the end of civilization, publicly encouraging people to have children and donating $10 million to a research initiative on population growth.

Privately, he was spending time with Simone and Malcolm Collins, prominent figures in the emerging pronatalist movement, and urging his wealthy friends to have as many children as possible. He believed the world needed more intelligent people, according to people aware of the conversations.

Collins declined to comment on his relationship with Musk, but said, “Elon is one of the people taking this cause seriously.”

Even as Musk fathered more children, he favored his son X.

By the fall of 2022, during a period when he and Boucher were broken up, he began traveling with the boy for days at a time, often without providing advance notice, according to people familiar with his actions.