Ed Joyce has announced his retirement from all forms of professional cricket less than a fortnight after taking part in Ireland's inaugural Test.

At 39, he will draw pride from the fact that he hung on just long enough to relish his part in history, but now it is contributing to Ireland's future that is at the forefront of his mind.

Joyce will assume a new role overseeing leadership development and acting as a batting coach in the Ireland performance system. Now that Ireland have achieved a long-held objective of Test status there are no illusions about the challenge they face to justify it: Joyce will be at the heart of their strategy

"I feel now is the right time to stop playing and get started on a new chapter. The recent Test match against Pakistan was such an incredible few days and was the perfect game for me to say was my last in professional cricket," said Joyce.

"I am very grateful to Cricket Ireland for giving me the opportunity to get involved in the coaching set up. I know I have a huge amount to learn about the art of coaching, but I know I also have a huge amount of knowledge that I'm determined to pass on to the next generation of Irish talent."

Joyce's career involved two spells with Ireland, bridging a five-year spell with England between 2006-11 when he tried, and failed, to fulfil his ambition to play Test cricket.

Instead, when England did turn to him it was, a little strangely, as a limited-overs cricketer, his 17 ODIs (at a modest average of 27.70) and two T20Is including a matchwinning century against Australia in 2007. But he did not quite achieve the career he had envisaged and switched back to Ireland.

That led to his Quiz Question achievement of becoming the Ireland batsman who played for two different countries in successive World Cups. Joyce had switched to England when the 2007 World Cup took place, having helped Ireland through the qualifying tournament, and became the first Irishman in the modern game to play for England. He reverted to Ireland, with ICC dispensation, just in time for the next tournament in 2011 and became part of Irish folklore as a member of the team that beat England in Bangalore.

In all, he went on to play over 100 more matches for Ireland, and in 2015 he hit the first double-century by an Irishman on home soil when he registered 231 against the UAE at Malahide.

There was also great respect for his talents as a batsman and captain in county cricket, where over 16 years he played for Middlesex and Sussex, leading both sides to honours and making 18,645 first-class runs at 47.95.

He left with warm words for a professional circuit now seemingly under constant scrutiny. "County cricket has been such a huge part of my life for the last 16 years and I firmly believe there was no better place for me to learn about the game," he said. "I was lucky to have played for two of the best in Middlesex and Sussex and I cherish the friendships I made and trophies I won over this period," he said.

Ireland now needs to produce cricketers in its own system, not in county cricket, and Joyce recognises that a considerable challenge presents itself in achieving the necessary standards.

"One of the challenges Irish cricket faces now is that we can no longer use county cricket as a finishing school for our youngsters," he said. "We need to produce our own cricketers through our domestic structure and I'm excited to be a part of that journey.

"We have always had cricketing talent in this country. Our job now is to develop that talent so that it is ready for the highest stage. The continued development of our club game, inter-provincial competitions, and Wolves programme are critical to this as is the development of world-class training facilities."

Graham Ford, Ireland's head coach, reacted: "It's always a sad occasion when a top-quality cricketer calls time on his career. Ed's brilliant performance statistics show clearly what an outstanding player he has been."

"Sadly his batting qualities will no longer be available to our national team. As the national team coach it is however very comforting to know that Ed's vast cricketing knowledge and experience will still be a part of our system and will play a vital role in developing future Irish cricketing stars."

Joyce's Test debut in Ireland's inaugural match against Pakistan earlier this month added that prized Test cap to a career in which he amassed 78 ODIs and 18 T20Is.

He is one of ten cricketers who have represented two countries in ODIs and was also the first player to play T20Is for two nations.

William Porterfield, Ireland's captain, praised Joyce's impact on Irish cricket. "He is the person, from my era, that showed that being a professional cricketer was a tangible dream across the water," he said. "He inspired a whole generation to show that it is possible."