OpenAI co-founder Sam Altman will return as boss just days after he was fired by the board, the firm has said.
The agreement “in principle” involves new board members being appointed, the tech company added.
It comes after Mr Altman was sacked on Friday triggering an open letter from staff who threatened to resign unless he was reinstated.
“I am looking forward to returning to OpenAI,” Mr Altman said in a post on X, formerly Twitter.
He added: “I love OpenAI, and everything I’ve done over the past few days has been in service of keeping this team and its mission together.
He added the firm would build on its “strong partnership with Microsoft.”
Last week, the board decided to remove Mr Altman, which led to co-founder Greg Brockman’s resignation, sending the star AI company into chaos.
The decision was made by the three non-employee board members, Adam D’Angelo, Tasha McCauley and Helen Toner, and a third co-founder and the firm’s chief scientist Ilya Sutskever.
But on Monday Mr Sutskever apologised on X, and signed the staff letter calling on the board to reverse course.
Microsoft, the biggest investor in OpenAI, then offered Mr Altman a job leading “a new advanced AI research team” at the tech giant.
On Wednesday, OpenAI said it had agreed Mr Altman’s return to the tech company in principle, and that it would partly reconstitute the board of directors that had dismissed him.
Former Salesforce co-CEO Bret Taylor and former US treasury secretary Larry Summers will join current director Adam D’Angelo, OpenAI said.
In a post on X, Mr Brockman also said he would be returning to the firm.
Emmett Shear, who had been appointed OpenAI’s interim chief executive, said he was “deeply pleased” by Mr Altman’s return after about “72 very intense hours of work”.
“Coming into OpenAI, I wasn’t sure what the right path would be,” he said on X, but added that Mr Altman’s reinstatement “was the pathway that maximized safety alongside doing right by all stakeholders involved”.
Microsoft boss Satya Nadella said the firm was “encouraged by the changes to the OpenAI board”.
“We believe this is a first essential step on a path to more stable, well-informed, and effective governance.”
Microsoft has heavily invested in OpenAI, but its links do not extend to the boardroom.
The battle at the top of OpenAI began suddenly on Friday when the then board announced it was firing Mr Altman, saying it had “lost confidence” in his leadership.
It accused him of not being “consistently candid in his communications” though what it was that he was allegedly not candid about remains unclear.
This then led to nearly all of OpenAI’s more-than-700 staff to sign an open letter threatening to leave unless the board resigned.
The letter stated that Microsoft, had assured them that there were jobs for all OpenAI staff if they wanted to join the company.
However, late on Tuesday it became clear that negotiations were underway focused on enabling Mr Altman to return.
But the upheaval of the past few days has raised questions about how a group of just four people could make decisions that have rocked a multi-billion dollar technology business.
In part this is because of OpenAI’s unusual structure and purpose.
It began life in 2015 as a non-profit – many charities have that status – with the mission to create “safe artificial general intelligence that benefits all of humanity”. The mission, did not include looking after the interests of shareholders.
In 2019 it added a for-profit subsidiary but its purpose remained unchanged and the not-for-profit’s board remained in charge.
The board members involved in Mr Altman’s dismissal have yet to explain their decision – Elon Musk is among those who have urged members to “say something”.
But that has yet to happen. In reaction to the news of the reinstatement and new board, on X Ms Toner posted just “and now we can all get some sleep”.