The US fast food giant said it had been consensual, but Mr Easterbrook had violated company policy and shown poor judgement.
In an email to staff, the British businessman 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.
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 Corporation in 2015.
The fast food giant's board voted on Watford-born Mr Easterbrook's departure on Friday after a review.
It will release details of his severance package on Monday, details of which will be closely watched.
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. 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.