The lawsuit by union pension funds and asset managers alleges the celebrity CEO strong-armed Tesla's board of directors into depleting the company's assets with the $2.6 billion all-stock deal for SolarCity.

The CEO at the time owned a roughly 22% stake in both Tesla and SolarCity, which was founded by his cousins, and some Tesla shareholders alleged the deal was aimed at bailing out Musk's investment in the solar panel company.

Kicking off a two-week trial in Wilmington, Delaware, Musk, wearing a dark suit, white shirt and a slightly askew dark tie, testified that he has tried "very hard not to be the CEO of Tesla, but I have to or frankly Tesla is going to die."

Board members and others involved in the deal will testify beginning as soon as Tuesday, when Musk will also return to the witness stand.

The lawsuit accuses Musk of dominating the board's deal discussions, pushing Tesla to pay more for SolarCity and misleading shareholders about the company's deteriorating financial health.

Musk told the court that the Tesla board handled the SolarCity deal and he was not part of the board committee that negotiated the terms.

"I don't even know what happened," he testified.

Musk responded calmly during cross-examination from shareholder attorney Randall Baron, but Baron's yes or no questions often elicited lengthy, meandering responses. At one point Musk called the lawyer "a bad human being."

Baron asked if the board vetted his Technoking title, which he gave himself in March.

"It generated a whole bunch of free press and Tesla doesn't advertise and it's helpful to general sales," he said. He called the title a joke: "I think I'm funny."

Shares of Tesla closed up about 4.4% on Monday at $685.75.

Central to the case are claims that despite his minority stake, Musk was a controlling shareholder of Tesla due to his ties to board members and domineering style. That designation would impose a tougher legal standard and increase the likelihood that the court would conclude the deal was unfair to shareholders.

Shareholders have asked the court to order Musk, one of world's richest people, to repay to Tesla what it spent on the deal.

Musk was initially questioned for about an hour by his attorney, Evan Chesler, who asked him to describe his relationship with the board.

"I'd say good," Musk replied. "They work hard and are competent. They provide good advice and are rigorous in acting on behalf of shareholders."

He said he did not set pay for directors or have the ability to fire or hire them. He also said that because he owned the same percentage of stock in both companies and there was no cash involved in the deal, he didn't benefit. He said the merger was aimed at combining Tesla's battery business with SolarCity's sustainable energy generation.

"There was no financial gain," he testified.

Legal experts said the judge will be looking for evidence that Musk threatened board members or that directors felt they could not stand up to him.

"It would be a surprise to most people if the court were to come out and say that he doesn't control here," said Brian Quinn, a professor at Boston College Law School. "Because he certainly acts like he does."

Tesla's directors settled allegations from the same lawsuit last year for $60 million, paid by insurance, without admitting fault.

Delaware Court of Chancery Vice Chancellor Joseph Slights will likely take months before he issues a ruling.

(Reporting by Tom Hals in Wilmington, Delaware; Editing by Noeleen Walder, Daniel Wallis, Andrea Ricci and Sonya Hepinstall)

By Tom Hals and Sierra Jackson