OpenAI co-founder Sam Altman will return as boss just days after he was fired by the board, the firm has said, APA reports citin BBC.
The agreement "in principle" involves new board members being appointed, the tech company added.
Mr Altman's sacking on Friday astonished industry watchers and led to staff threatening mass resignations unless he was reinstated.
"I am looking forward to returning to OpenAI," 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.
Last week, the board decided to remove Altman, which led to co-founder Greg Brockman's resignation, sending the star artificial intelligence (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, which uses OpenAI technology in many of its products - and is its biggest investor - then offered Altman a job leading "a new advanced AI research team" at the tech giant.
Then on Wednesday, OpenAI said it had agreed 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, Brockman also said he would be returning to the firm.