Pakistan captain Misbah-ul-Haq has said that he will retire from ODI and T20 cricket after the 2015 World Cup, but will continue playing Test cricket.

"Seven days back, I informed the PCB that it was the right time to quit the ODIs and T20s, but I will continue playing Test cricket," Misbah told ESPNcricinfo. "I've thought about this for a long time. The World Cup is an important event and I want to play it well and then quit."

Shaharyar Khan, the PCB chairman, told Reuters the board had accepted Misbah's decision and credited him for being a source of inspiration.

"He has been a big source of inspiration for the Pakistan team since the spot-fixing scandal and it is his personal decision to retire from ODIs after the World Cup," he said.

Since his debut in April 2002, Misbah, 40, has played 153 ODIs for Pakistan, scoring 4669 runs at an average of 42.83 with 37 fifties. He currently holds the record for most ODI runs without a century. After being dropped from the side in October 2004, Misbah made a comeback three years later, in October 2007. He faced exclusion from the ODI squad again between October 2009 and 2010.

Misbah took over as ODI captain from Shahid Afridi in May 2011, following a feud between the then-chairman Ejaz Butt and the allrounder. Including the one game that he captained in 2008, Misbah has led Pakistan in 78 matches and won 41.

Misbah played 39 T20s for Pakistan, leading the side in eight of them. His last T20 for Pakistan was in February 2012, after which he stood down as captain and was subsequently dropped from the shortest format. He continued to play domestic T20 cricket and also had stints in the Indian Premier League, and the Caribbean Premier League.

Misbah's poor ODI form was in focus last year, when he scored 285 runs in 12 matches at an average of 23.75 in 2014. The poor form also affected his captaincy and in October, Misbah had admitted that the prospects of captaining the side in the 2015 World Cup depended on his return to form. The PCB, however, continued to back Misbah and asserted that he would remain the side's ODI captain until the World Cup.

The Test series against Australia that followed the ODIs marked a turnaround as Pakistan flattened their opponents. Misbah also scored the joint-fastest Test hundred, off 56 balls, equalling Viv Richards' record. A hamstring injury forced him out of the last three ODIs of the five-match series against New Zealand in December and Afridi led the side in his absence. Misbah is expected to be fit for the World Cup.

Looking back on his career, he said he had much help along the way and many to thank. "I want to thank Almighty Allah who helped me to play for such a long time and I captained the one-day team for almost four years. I want to thank all my family members who supported me, the PCB which put confidence in me in good and bad times and supported me as a captain, thanks to all my fellow players, my team members, my coaches, my teachers, my fans, whosoever supported me to become a cricketer, even groundsmen, my departments, my teams, my regions, my divisions, my clubs. I am happy that I have reached a stage to take such a decision. I will have their support in the World Cup and will try to live up to their expectations."

The debate on Pakistan's limited-over captaincy has been raging for last two years but the PCB had continued with Misbah, partly because of a lack of options. Sohaib Maqsood is one of the contenders being seen as a potential captain by the PCB but his prospects depend on performance and impact during the 2015 World Cup. Maqsood led Pakistan A on a tour of the UAE in October last year and is seen as one of the respected players in the dressing room.

Earlier, Afridi had also announced his retirement from the ODI cricket after World Cup. The allrounder, however, will continue playing T20 cricket, the format in which he leads Pakistan, and wants to win the 2016 World T20 in India before quitting international cricket.