Andrew Strauss has announced his retirement from professional cricket, ending a 10-year career at international level, the last three of which he was England's Test captain. Alastair Cook, the one-day captain, will take on the Test job.

His decision comes after a week of soul-searching during a family break following the 2-0 loss against South Africa which meant England lost the No. 1 Test ranking and also comes at a time when Kevin Pietersen's exile from the team has dominated the agenda.

Strauss played down the significance of the current Pietersen situation in his decision saying it "was not a factor at all" and retiring was on his mind before the series against South Africa started. He did, though, admit that his lack of runs had played a major part.

Strauss' decision ends a career that began in 1997, an international career that started in 2003 and captaincy reign that began early in 2009 in the wake of the Pietersen-Peter Moores fall out.

"After much thought over the last few weeks, I have decided to step down as England Test captain and announce my retirement from all forms of cricket," Strauss said. "It has clearly been a tough decision to make, but I believe that it is both in the best interests of the England cricket team and myself to step down at this stage.

"There are too many people who have helped me on this incredible journey to mention them all by name, but I would like to thank all the Middlesex and England players I have played alongside, as well as the phenomenal coaches and support staff with whom I have been fortunate enough to work.

"Particular mention has to go to Andy Flower and Duncan Fletcher in that regard. It would also be remiss of me not to thank Middlesex, the ECB and the PCA for their support and guidance over the years.

"No one can play international cricket for any length of time without having an incredibly strong support network around them, and I would like to take this opportunity to thank my family for going through it all alongside me over the course of my England career.

"I am extremely proud of everything I have achieved as a cricketer, and I have found myself very fortunate to play in an era when some of English cricket's greatest moments have occurred. I have loved every minute of it. All that remains is for me to wish Andy, Alastair and the rest of the team the very best for the coming months. I will be an interested spectator."

Strauss, 35, played his 100th Test at Lord's against South Africa and after the loss he said he still had "a lot of desire" but did not categorically declare his intention to continue leading the side. Strauss said at the time he was keen to take a break and then discuss the future with the coach Andy Flower.

ESPNcricinfo were the first to suggest immediately after the Test that perhaps Strauss was considering resignation.

The South African series was a difficult one for Strauss, who not only had to deal with the ongoing Pietersen saga but also his own struggle for runs - his best score during the three Tests was 37. Cook, who took on the ODI captaincy last year, will now step into the Test role and will start with the tour of India later this year.

Cook said: "Andrew's contribution to England cricket in recent years is evident to everyone who follows the sport but only those of us who have been lucky enough to share a dressing room with him are fully aware of his immense contribution to our success.

"He has been a fantastic captain, has led from the front for three and a half years and is a true ambassador for the game. To have played 100 Tests for your country is a phenomenal achievement and I want to congratulate him on a superb career. I know this can't have been an easy decision for him and everyone in the dressing room will be sad to see him go.

"I'm very excited by this new challenge, it is a huge honour to be appointed Test captain and am very much looking forward to captaining the side in India this winter and beyond, but my immediate focus is on this current NatWest one-day series. Once the series is over I will turn my attention to the Test captaincy and building on the work Andrew has started."

David Collier, the ECB chief executive, said: "On behalf of the ECB and everyone involved in cricket I'd like to thank Andrew Strauss for his outstanding contribution to the game.

"Andrew has been a highly successful captain and opening batsman for Middlesex and England, who will be remembered for leading the side to two Ashes victories and to the top of the Test rankings. He has shown tremendous integrity, dedication and commitment both on and off the field and under his leadership the side has grown immeasurably and reached new levels of professionalism.

"Andrew's calmness and authority when dealing with some of the most difficult moments in our sport in recent times should be applauded and I have no doubt that his contribution as an ambassador for the game will be recognised by anyone who has had an opportunity to spend time with him. His legacy within the game will be felt for many years to come and we now need to continue to build on the progress we have made under his leadership."

Strauss made his debut for England in 2004, scoring a century against New Zealand at Lord's in a performance that was enough to push former captain Nasser Hussain into retirement, and his most recent Test against South Africa was his 100th Test. When talking recently to mark the occasion he spoke about his desire to continue but events of recent weeks, including the controversy surrounding Pietersen, appear to have changed his mind.

As captain, Strauss led England to new heights, including back-to-back Ashes triumphs in 2009 and 2010-11 plus the No.1 Test ranking which they held for a year before losing the series against South Africa. That was the first home Test series England had lost under Strauss' leadership and just the third of his entire stint.

However, the runs had largely dried up for Strauss in recent years. The two hundreds he scored against West Indies earlier this season hinted that he could recapture some of his best form but reality hit home against South Africa when he scored 107 runs in six innings. Having started his time as captain with three hundreds against West Indies in 2009 he managed just four more. He will finish with 21 Test centuries, one behind the England record held by Geoff Boycott, Colin Cowdrey and Wally Hammond.

In his 100 Tests Strauss has scored 7037 runs at 40.91 and in the 50 Tests he captained (which included four before being appointed fulltime captian, against Pakistan in 2006) he won 24 of them.

Strauss is the third England captain to resign either during or after a series against a South Africa side led by Graeme Smith. Hussain stood down early in the 2003 series and Michael Vaughan ended his time as captain after South Africa won the 2008 series with victory at Edgbaston.