Graeme Swann, the England offspinner, has retired from all international cricket and first-class cricket with immediate effect.

Swann, 34, will not play in the final two Tests of the Ashes tour and will finish his career with 255 wickets at 29.96 from his 60 Tests. However, on a disappointing tour of Australia in which England have gone down 3-0 after the first three Tests, Swann has been one of the senior players who has failed to have an impact and has managed only seven wickets at 80.

Graeme Swann on... Who should replace him... "I think Monty's going to come in and do a great job in this game coming up this week. Whoever ends up taking the role full time I think they'll do a great job as well. Personally I hope little Scottie Borthwick gets a chance before long. He's a legspinner with a bit of x-factor and he can bat as well. Despite supporting Man City and Sunderland, two of the worst teams in England, he's a good guy." What he'll miss the most... "This England team has been my family for the best part of a decade now. You spend so much time with guys who you love to pieces. It's going to be really hard not going to breakfast with a miserable Jimmy Anderson every morning, breaking him in slowly through the day and seeing a smile about tea-time. Things like that will be hard." The future of the England team... "We've got very exciting young players in England. Ben Stokes showed last week what a great player he is. I think he could be a player you could almost build a team around, not putting pressure on him - well, that is putting pressure on him I suppose - but if he can continue in the vein of form he started in, you could build teams around players like that." Telling Alastair Cook of his decision... "He is one of my best mates so it should have been a very easy conversation but it actually made it doubly hard, just to sit down over a coffee and blurt it out. It was like one of his team talks, it didn't make any sense. But I got it out in the end."

He said that although he knew retirement was not far away earlier this year, given the struggle for his body to get through five-day matches, the temptation of potentially winning a fourth consecutive Ashes series had encouraged him to take part in the tour of Australia. Swann said that with the series decided and his mind made up, there was no point in playing on at the MCG or in Sydney.

"When I came out on this trip I half expected it to be my last tour for England," Swann said in Melbourne on Sunday. "I was desperately hoping to win the Ashes out here again like we did in 2010-11 but with the Ashes gone now in those three Test matches, personally I think to stay on and selfishly play just to experience another Boxing Day Test match and another Sydney Test match would be wrong.

"It would be wrong for the team, wrong for me as well. It's time for someone else to strap themselves in and enjoy the ride like I have done. It's time for England to rebuild and refocus on winning back these big series. Me hanging around with the decision already made in my head wouldn't be right.

Graeme Swann claimed two important wickets Getty Images

"My body doesn't like playing the long forms of cricket. My arm doesn't cope very well with bowling 30 or 40 overs in the first innings and then repeating it in the second innings a day later anymore. I could feel my performances tapering off in the back end of games and I wasn't happy with that. I'm not willing to just hang on and get by being a bit-part player. I want to be a guy who wins matches for England, and I don't feel I was doing that in the second innings anymore.

"It is disappointing. At the end of The Oval Test match last year, I think why didn't I just stop then? I knew more or less that the time was coming up. But then I'd never forgive myself. We had the chance of coming out here and potentially winning four Ashes series on the bounce. I'd never have forgiven myself had I not come out here and given it a crack."

Swann's decision means Monty Panesar is likely to take the role of lead spinner for the remaining two Tests, but the broader question of who will be England's long-term Test spinner remains unclear. Swann himself nominated the Durham legspinner Scott Borthwick as a potential replacement who could add to the all-round "x-factor" that Ben Stokes had already brought to the team on this tour.

Swann noted that the success of Stokes, who scored England's first century of the Ashes series in their defeat at the WACA, was indicative of the way the senior men had failed to stand up on this trip. It was a very different scenario in England earlier this year, when Swann was the leading wicket taker from either side with 26 victims, and at the time it appeared that he may still have some chance of surpassing Derek Underwood to become England's leading Test spinner of all time.

However, Swann will finish 42 wickets short of Underwood's tally of 297, leaving him sixth overall on England's all-time wicket tally behind Ian Botham, James Anderson, Bob Willis, Fred Trueman and Underwood. That was a significant achievement given that Swann did not make his Test debut until the age of 29, but his consistency meant that he missed only six of the 66 Tests that England had played since then.

Since his debut in December 2008, Swann was Test cricket's leading wicket taker from any country, his 255 victims well ahead of Anderson (232), Stuart Broad (207) and Dale Steyn (205), who were the next best in that period. He was Man of the Match on six occasions, most recently for his 10-wicket haul against New Zealand at Headingley in May. Swann told his England team-mates of his decision on Sunday morning in Melbourne.

"They've all been very supportive and congratulated me on my career and wished me luck for the future," he said. "I wished them all the luck in the world. I'm an England fan and I want to see England cricket No.1 in the world, winning games and winning Ashes series. I think the core of that team in the change room are the guys to do that."

England's coach, Andy Flower, said: "Graeme Swann has made an outstanding contribution to the England cricket team in all formats throughout an incredibly successful career and I would like to congratulate him on all that he has achieved.

"His commitment, competitive spirit and sense of humour have been recognised and admired by team-mates and supporters alike and he has played a big part in England's success over the last five years. The dressing room will be a very different place without Graeme's unique personality and I would like to wish him all the very best for the future."

Swann said his personal highlights included playing in three triumphant Ashes sides, as well as the World Twenty20 success in the West Indies in 2010. Apart from his Test appearances, Swann will depart with 104 wickets from 79 one-day internationals and 51 wickets from 39 Twenty20 internationals. He also paid tribute to his two county sides, Northamptonshire and Nottinghamshire.