He was India captain Rohit Sharma's opening partner in the home T20 series against Afghanistan earlier this year but his place looked under threat as he struggled for runs in the IPL
The left-handed batsman reached the milestone in their World Cup opener against Afghanistan at the Manuka Oval in Canberra on Wednesday.
The top allrounder is closely followed by opener Tamim Iqbal who has accumulated 3,990 runs in 136 ODIs.
Bangladesh were struggling when Shakib, playing his 142nd ODI, came in at five needing 23 more runs to reach 4,000-run mark.
He clipped Aftab Alam towards the leg side in his 26th delivery to sign up for the club with a boundary.