McEwan (pictured) has a 12 month notice period and will remain in his position until a successor has been appointed and an orderly handover has taken place.
The effective date of his departure will be confirmed in due course, the bank said.
Chairman Howard Davies said that the board was grateful for the huge contribution he has made in one of the toughest jobs in banking.
He added: “His successful execution of the strategy to refocus the bank back on its core markets here in the UK and Ireland has helped to deliver one of the biggest UK corporate turnarounds in history.
“RBS is now well positioned to succeed in the future in what is a rapidly evolving landscape for the banking sector. We will be conducting an internal and external search for his successor, which will start immediately.”
Ross McEwan added: “It has been a privilege to lead this great bank and to have worked with some really outstanding people in the process. It is never easy to leave somewhere like RBS.
“However with much of the restructuring done and the bank on a strong and profitable footing, I have delivered the strategy that I set out in 2013 and now feels like the right time for me to step aside and for a new CEO to lead the bank.
“I would like to thank the board, shareholders and UKGI for the support they have shown me during my time at the bank and our colleagues for the remarkable job in turning this bank around.”
In 2018, the bank completed £30.4bn worth of gross mortgage lending, down from its £31bn total in 2017, but maintained its 11.3% market share.