McDonald's has fired its chief executive Steve Easterbrook after he had a relationship with an employee.
The US fast food giant said the relationship was consensual, but Mr Easterbrook had "violated company policy" and shown "poor judgement".
The British businessman, who earned nearly $16m (£12.3m) last year, is due to receive 26 weeks of pay.
The full value of the deal was not clear. He is also eligible for a bonus, if the firm hits its performance goals.
Bloomberg estimated that he will leave with more than $37m, the bulk of which includes previously granted shares.
In exchange, Mr Easterbrook has agreed not to work for a competitor for at least two years.
In an email to staff, Mr Easterbrook acknowledged the relationship and said it was a mistake.
"Given the values of the company, I agree with the board that it is time for me to move on," he said.
The company's top human resources officer has also left the company, McDonald's said.
Mr Easterbrook, 52, who is divorced, first worked for McDonald's in 1993 as a manager in London before working his way up the company.
He left in 2011 to become boss of Pizza Express and then Asian food chain Wagamama, before returning to McDonald's in 2013, eventually becoming its head in the UK and northern Europe.
He was appointed chief executive of McDonald's in 2015.
Mr Easterbrook is widely credited with revitalising the firm's menus and restaurants, by remodelling stores and using better ingredients. The value of its shares more than doubled during his tenure in the US.
Under his leadership, McDonald's also expanded its delivery and mobile payment options to emphasise convenience.
The fast food giant's board voted on Watford-born Mr Easterbrook's departure on Friday after a review. He has also stepped down as McDonald's president and member of the board.
McDonald's said it has longstanding rules against conflicts of interest.
It declined to provide further information about the person with whom Mr Easterbrook had the relationship, including whether the person was a direct report or remained employed by the company.
Employment lawyer Ruby Dinsmore, of Slater and Gordon, said it is now common for firms to have either outright bans on relationships, or to have notification clauses requiring individuals to disclose them.
Potential conflicts of interest or litigation if a relationship turns sour were becoming a real risk for companies, she told the BBC.
"Some people may view this an an invasion of privacy," she said. "But businesses have their own interests to protect as well."
In the era of MeToo "companies are very keen to be seem not only to have a policy for this type of situation, but also to be seen to be enforcing it at all levels," she said.
The company has been criticised over the amount it pays shop staff, and Mr Easterbrook faced scrutiny for his $15.9m pay packet in 2018, which included a roughly $1.3m base salary, as well as benefits and bonus.
It was 2,124 times the median employee salary of $7,473.
He will be replaced by Chris Kempczinski, most recently president of McDonald's USA, with immediate effect.
In a statement, Mr Kempczinski thanked Mr Easterbrook for his contributions, adding: "Steve brought me into McDonald's and he was a patient and helpful mentor."
Last year Intel boss Brian Krzanich stepped down for having a consensual relationship with an Intel employee, which was against company rules.
He had been in the post since May 2013.