Sri Lankan cricketing legend Kumar Sangakkara said on Monday he will retire from first-class cricket at the end of the present English county championship season in September.

The 39-year-old – fifth in the list of all-time Test run scorers averaging more than 57 runs in 134 Tests, making 11 double centuries – is still in prime form having scored two centuries for Surrey in their match with Middlesex which finished on Monday.

However, Sangakkara – also one of the all-time great limited overs batsmen and a member of the Sri Lanka side that reached both the 2007 and 2011 World Cup finals (losing to Australia and India respectively) – said he could sense the time was right to retire.

“You try to fight the inevitable but you need to get out while you’re ahead,” Sangakkara, who was a pivotal member of the Sri Lanka team that lifted the 2014 World Twenty20 trophy and lost in both the 2009 and 2012 finals, told the BBC.

“It’s the last time I’ll play a four-day game here. I’ll be 40 in a few months, this is about the end of my time in county cricket.”

Sangakkara, who formed a swashbuckling partnership on many occasions with fellow Sri Lankan legend Mahela Jayawardene, said he didn’t want to make the error of overstaying his welcome.

“The biggest mistake that sometimes you can make is that you think you’re better than you really are,” he said.

“Cricketers, or any sort of sportsperson, have an expiry date and you need to walk away.

“I have been very lucky to play for as long as I did so but there’s a lot more life to be lived away from the game.”