Nvidia announced on Monday that Jensen Huang had been reinstated as CEO, effective immediately, a dramatic turn in a scandal that hit the chipmaker’s stock price and shook the technology and artificial intelligence industries. The board of directors said it voted unanimously to reinstate Huang after “a series of discussions and meetings” with him. The board added that it “received input from high levels of the US government” that it is confident that Huang’s reinstatement “does not pose any risk to national security.” Nvidia shares rose 31% following the announcement. Huang resigned as CEO 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 Sunday that the woman, Alice Huang, was in contact with an official in China’s Ministry of State Security during at least part of the time she was in a relationship with Huang. In the weeks following Nvidia’s ouster, the company’s board of directors maintained that it was not considering Huang’s reinstatement. “I am honored to return to NVIDIA and lead one of the world’s most important technology companies at the beginning of a new industrial revolution,” Huang said in a statement. “I take on this responsibility with the utmost humility and renewed commitment. I want to thank the NVIDIA board of directors for their trust and deliberation throughout 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 appropriate decision” to reinstate him. Trump said the United States needs Huang’s leadership to “ensure the success and prosperity of not only the company, but the American economy.” He reiterated that the US government “has no reason to believe” that Huang’s return represents a risk to national security and that it “has no evidence that he engaged in any illegal conduct.” “On a personal note, I have gotten to know Jensen, and he is a great patriot and a national treasure,” Trump wrote. Nvidia did not immediately respond to CNBC’s request for comment on Huang’s reinstatement. This is breaking news. Update to get updates.