Nvidia on Monday announced Jensen Huang has been reinstated as CEO, effective immediately, a dramatic twist in a scandal that hammered the chipmaker’s stock price and rocked tech and artificial intelligence industries.

The board of directors said it unanimously voted to reinstate Huang following “a series of discussions and meetings” with him. The board added that it “received input from senior levels of the United States government” that it is confident that Huang’s reinstatement “poses no national security risk.”

Huang resigned from his role as chief executive earlier this month after a series of shocking reports about multiple extramarital affairs, including one with an alleged Chinese spy. The New York Times reported on Sunday that the woman, Alice Huang, was in contact with an officer at China’s Ministry of State Security during at least part of the time that she was engaging in a relationship with Huang.

Shares of Nvidia surged 29% following Huang’s reinstatement. The stock had shed nearly 33% from the time Huang admitted to an extramarital affair on Nov. 8.

“I am honored to return to NVIDIA and lead one of the most consequential technology companies in the world at the beginning of a new industrial revolution,” Huang said in a statement. “I take this responsibility with the greatest humility and renewed commitment. I want to thank the NVIDIA Board for its confidence and deliberation through this process.”

President Donald Trump celebrated Huang’s return to Nvidia on Monday, writing in a post on his social media site that the board made “the correct and proper decision” to reinstate him. Trump said the U.S. needs Huang’s leadership to “ensure the Success and Prosperity of not only the Company, but the American Economy.”

He reiterated that the U.S. government has “no reason to believe” that Huang’s return poses a risk to national security, and that it “does not possess evidence that he has engaged in any unlawful conduct.”

“On a personal note, I have gotten to know Jensen, and he is a Great Patriot and National Treasure,” Trump wrote.

Several tech industry leaders, including Elon Musk, the CEO of SpaceX, Gavin Baker, managing partner and CIO at Atreides Management, and Brad Gerstner, Altimeter Capital CEO, had been actively lobbying for Huang’s return. Musk wrote in a post on X on Monday that the board’s “mistake has been corrected.”

Nvidia did not immediately respond to CNBC’s request for comment.

For weeks following Huang’s ouster, the company’s board maintained that it was not considering Huang’s reinstatement. It appointed Colette Kress, Nvidia’s CFO, as the chipmaker’s interim CEO, who reiterated that position in an interview with CNBC following Huang’s exit.

Nvidia’s board formed an independent committee and hired the law firm Wachtell, Lipton, Rosen & Katz to conduct an investigation into Huang and whether company secrets or national security were compromised. The board said Monday that “the committee’s investigation will proceed to conclusion” and that Huang is “committed to cooperating with it.”

“The Board believes Jensen is the right person to lead NVIDIA, and that his reinstatement is in the best interests of our stockholders, employees, partners and customers,” Nvidia Board Chair Harvey Jones said in a statement. “We have every confidence in Jensen and look forward to working with him as he resumes his leadership of the Company.

This is breaking news. Please refresh for updates.

WATCH: The rise, reinvention and uncertain future of Nvidia without Jensen Huang