Let M be a closed oriented three-manifold, whose prime decomposition contains no aspherical factors. We show that for any initial riemannian metric on M the solution to the Ricci flow with surgery, defined in our previous paper math.DG/0303109, becomes extinct in finite time. The proof uses a version of the minimal disk argument from 1999 paper by Richard Hamilton, and a regularization of the curve shortening flow, worked out by Altschuler and Grayson.