Supermarket boss Justin King was hailed as the saviour of Sainsbury's today as he announced plans to step down as chief executive after 10 years.

Company chairman David Tyler said that when Mr King joined the firm it was close to being "on its knees".

Profits have since trebled and the grocer recently posted its 36th consecutive quarter of growing sales, while it is now neck-and-neck in the battle with Asda to be Britain's second biggest supermarket behind Tesco.

Mr King - who has waived the right to a £1.7 million cash severance payment on departure - is to step down at the annual general meeting in July.

He brushed off as "speculation" long-standing rumours that he will be offered a role in charge of Formula One, though he could not resist a motoring metaphor when referring to his future career - insisting there was "plenty more in the tank".

Shares were down 2% on the announcement of Mr King's departure as Mr Tyler indicated that the board had not wanted him to leave.

The chairman said: "He has been an absolutely inspirational leader for Sainsbury's over the last decade and he has affected one of the most striking turnarounds in business.

"Sainsbury's was close to being on its knees. Its shelves were often unstocked. Morale was at rock bottom. Market share was falling. Profits were inadequate.

"Justin was on a mission to make Sainsbury's great again. It is a mark of an extraordinary leader to go when his audience is asking for more."

Mr King has overseen store transactions increase to around 24 million a week, a rise of about 10 million. Sales in the most recent financial year were £25.6 billion, up from £16.1 billion. Underlying profits have almost trebled to £756 million.

The supermarket now has a £1 billion online grocery business and is also rapidly expanding its network of smaller convenience outlets. Total store numbers have doubled to 1,213 under the departing boss's tenure.

Mr King has also faced the challenge of pressure from the likes of Aldi and Lidl gnawing away at the dominance of the big four grocers - who also include Tesco, Asda and Morrisons.

But despite the competition from discounters as well as the growth of Waitrose at the other end of the sector, Sainsbury's has expanded its market share.

Mr King said he had long thought he would hand over the reins after ten years, and said forward planning for succession had begun three or four years ago.

Sainsbury's defied expectations that its successive quarters of sales growth would stall in its latest quarterly trading update, but the increase it did achieve was just 0.2% and the supermarket was forced to admit full-year growth would be below expectations.

Mr King said he was leaving the supermarket in good shape, saying: "I believe the best years are still to come. I hope that will be the final mark of my leadership - that I handed over at a time when there could be an orderly transition."

The 52-year-old dismissed claims of a move to Formula One as "entirely speculative".

"I can tell you definitively that I have 100% focused on my job here at Sainsbury's. I have not talked to anybody about any job. I know you may not believe that but that's the facts as they stand.

"I am optimistic, now it is clear what my tenure is at Sainsbury's that opportunities will come my way.

"I am fortunate that, relatively speaking, I am a young man. I think I have got plenty more in the tank and I am looking forward to the next stage of my career."

Mr King was head of Marks and Spencer's food division before taking over from Sir Peter Davis at Sainsbury's in 2004.

But he squashed suggestions that he might return to M&S should the troubled reign of Marc Bolland come to an end, indicating that a 12-month non-compete clause in his current contract was likely to rule him out.

The announcement of Mr King's departure comes eight months after he played down reports he was about to leave, instead comparing his tenure to the 26-year stint of Sir Alex Ferguson at Manchester United and insisting he was committed to the business.

He will be replaced by commercial director Mike Coupe, who sought to strike a note of continuity when he said: "It is very much business as usual."

Mr Tyler said there had been a thorough review of external candidates before deciding on his appointment, but that Mr Coupe - who has previously worked at Tesco, Asda and Iceland, was the best man for the job.

He added: "He has worked hand-in-hand with Justin over the past decade and has a proven track record of success making him the natural choice to take the company forward."

Shore Capital analysts said perhaps Mr King's greatest achievement had been continued growth in the recession, but while his move was disappointing the continuity represented by Mr Coupe should mean "few shocks and surprises".