Former England wicketkeeper James Foster is to retire from cricket when his Essex contract expires at the end of the season and move into coaching.

The 38-year-old rose through the ranks at Essex from his days as a junior cricketer when he also represented England Under-19s.

He went on to make seven Test appearances for England and 11 in one-day internationals, while at domestic level he captained Essex, based in Chelmsford, east of London, to the 2017 County Championship title.

READ: Moeen has no sympathy for 'rude' Australia

“It has been a real privilege to play for my home county and I am extremely proud to have represented England,” said Foster, widely regarded as one of the best wicketkeepers of his generation, in a statement.

“Whilst playing has now come to an end, I am incredibly excited about the next phase of my career,” added Foster, who has moved into coaching roles both at the school level and with a number of Twenty20 sides, including Australia's Sydney Thunder.

“Thank you to all the Essex players for making it such an enjoyable changing room and winning the County Championship in 2017 was one of my happiest memories,” said Foster, who made his Test debut against India in Mohali in December 2001 and was, in the eyes of many observers, unfortunate not to win more Test caps.

ALSO READ: Pietersen tells England to drop Broad and Jennings

“What I appreciated most at the club was the way coaches, management, support staff, stewards and supporters have always made my family feel so welcome at the club, for that, I am truly grateful.”

Foster, who made his County Championship in August 2000, scored 13,761 First-Class runs at an average of 36.69, including 23 hundreds with a highest score of 212 against Leicestershire in 2004.  He also had 839 First-Class dismissals to his credit.

Essex captain Ryan ten Doeschate said: “Fozzy has been the rock at Essex for all of the time I've played here, the most thorough professional and a cherished friend through thick and thin.b Over the last 15 years, he has been a big presence and a great example in the dressing room, we are going to miss him next season.”