McEwan, who will stay in the role until a successor is found and gets their feet under the desk, said it was time to leave as he felt he had completed the turnaround for which he was hired.
RBS, which received a £45.5bn bailout from the government during the financial crisis in 2008 and is still 62%-owned by the state, returned to the dividend list in February after last year saw it make a first profit for nine years.
McEwan said: "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."
Shares in RBS, which is due to report first-quarter results on Friday, fell 1% to 254p after almost an hour of trading on Thursday.
Chairman Howard Davies said the search for a successor to the New Zealander “will start immediately”, with both internal and external candidates considered.
He added: “The board and I are grateful for the huge contribution Ross has made in one of the toughest jobs in banking. 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.”
Shore Capital analyst Gary Greenwood said McEwan had been in place as RBS "resolved all of its major legacy issues", though he said "significant further work remains to improve profitability and returns".
He added that McEwan's 12-month notice period should provide ample time to find a suitable successor without any major disruption to the management of the business.
-- Adds analyst comment, share price --