The England & Wales Cricket Board (ECB) said in a statement today that Yardy needed advice and treatment, "to overcome an illness he has been managing for a prolonged period of time."
Yardy said in a statement released by the ECB that leaving as England prepared for a crucial quarter-final against Sri Lanka was a difficult decision to make. "I felt that it was the only sensible option for me and I wanted to be honest about the reason behind that decision."
Yardy is the second England player to leave a tour because of depression. Marcus Trescothick, the ex-opener, fought and failed to beat the illness that attacked him whenever he left his family and home to travel abroad.
"I would like to wish the squad all the very best ahead of the game on Saturday. I would appreciate some privacy over the coming weeks while I spend time with family and close friends ahead of what I hope will be a successful season for Sussex," Yardy said.
The ECB has applied to the International Cricket Council (ICC) to replace Yardy, who has played a peripheral part in England's World Cup campaign.
"The decision was taken in close consultation with the England medical team after it was agreed Yardy should return home immediately to receive the best possible advice and support as he seeks to overcome an illness he has been managing for a prolonged period of time," The ECB said.
The 30-year-old played in just three of England's six group stage games, scoring 19 runs and taking two wickets.
Hugh Morris, the ECB chief executive, said it was important for Yardy to get well soon.
"Michael has been an integral part of the England set up in recent years and while he will be missed in the knock out stages of the World Cup, our priority now is to ensure that he returns home to his family and is able to spend time recovering with a strong support network around him," he said.
Gayle lashes out at criticism from Windies coach
Chris Gayle, the West Indies batsman, has apologised for the team's limp World Cup exit, but says it is "easy" to blame the senior players.
Ottis Gibson, the coach, used a news conference after the 10-wicket defeat by Pakistan to criticise senior players including Gayle for failing to perform at the tournament.
The 31-year-old Gayle used his Twitter account to respond, writing that it's "easy to blame the senior players, but difficult to accept the truth!!!"
Gibson said the team's management would take some "serious decisions" before West Indies play a home series against Pakistan in April, and that they would build the future on young players.
Imran wants Shoaib back in the Pakistan team
Imran Khan, the 1992 World Cup-winning captain, wants to see fast bowler Shoaib Akhtar restored to the Pakistan team if they meet India in the World Cup semi-finals. Akhtar has not played since the defeat by New Zealand midway through the group stages and has since announced he will end his 14-year international career following the tournament. Khan said in today's edition of the Urdu language newspaper Daily Express that the 35-year-old Akhtar "should get a chance and share the new ball with Umar Gul" if India beats Australia on Thursday and sets up a semi-final against Pakistan. Pakistan has won all their games since Akhtar was dropped, culminating in yesterday's 10-wicket victory over West Indies in the quarter-final.