England all-rounder Andrew Flintoff is to retire from Test cricket at the end of the Ashes series against Australia because of persistent injury problems, the England and Wales Cricket Board said on Wednesday.
The 31-year-old will continue to make himself available for one-day and Twenty20 fixtures, the ECB said.
"My body has told me it's time to stop. Since 2005 I've had two years when I've done nothing but rehab from one injury or another," Flintoff said.
"It's been something I've been thinking about for a while and I think this last problem I've had with my knee has confirmed to me that the time is now right."
Flintoff's participation in the second Test at Lord's, which starts on Thursday, remains in doubt after he suffered his latest injury in the first Test, when he bowled 35 overs.
The Lancashire all-rounder had surgery for a torn meniscus in April, cutting short his time in the Indian Premier League.
The news is a big blow to England as Flintoff is not only a key strike bowler and destructive batsman but a huge personality who lifts his team mates and the crowd.
Australia captain Ricky Ponting said on Wednesday he thought it had been a risk using Flintoff as one of only three seamers in Cardiff but added: "He showed the galvanizing effect he can have on the second afternoon (in Cardiff), when his spell after lunch really got the crowd going."
Flintoff made his England debut in 1998 and has played 76 Tests and 141 one-day internationals. He averages 31.69 in Tests and has taken 219 wickets.
Hugely popular with fans for his whole-hearted approach and winning personality, he was a key member of the 2005 Ashes-winning side.
However, his career has been blighted by injury and he has missed more than 20 Tests over the last three years.
He had four separate operations on his ankle between 2005 and 2007 and has problems with his hip, groin, shoulder and back.