OpenAI co-founder Sam Altman will return as CEO just days after he was fired by the board, the firm has said.
The agreement "in principle" involves a new board being installed, 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 social media.
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.
"I'm looking forward to returning to OpenAI, and building on our 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-employees 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, formerly known as Twitter, 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 morning OpenAI detailed Mr Altman's return to the tech company adding it had agreed in principle to partly reconstitute the board of directors that had dismissed him.
The initial board will constitute former Salesforce co-CEO Bret Taylor, former US treasury secretary Larry Summers, and Mr Adam D'Angelo, OpenAI said.
BBC