The number of CTCs in peripheral blood is of great significance for the early diagnosis, recurrence and prognosis evaluation of tumor patients. Consequently, it is required to develop simple and effective technique to realize the capture and detection of rare number CTCs. Herein, a SiO2, gelatin and biotinylated EpCAM aptamer P1 modified Fe3O4 immunomagnetic nanoparticles (IMNs) were prepared for the specific capture and nondestructive release of trace amounts of CTCs. Then, utilizing the peroxidase-like activity of single-walled carbon nanotubes (SWCNTs) and the effect of non-specific DNA sequences on this activity, a colorimetric probe was constructed by modifying the three DNA sequences (mDNA) onto the IMNs. When target cell was present, due to the specific interaction between cells and P1, the conformational structure of P1 was changed. Consequently, the mDNA linked with P1 on IMNs was replaced by the cell and released from IMNs. In this way, the quantification of captured CTCs could be converted to that of released mDNA. This strategy combined the capture and detection of CTCs as a whole and could detect down to 10 cells with a high selectivity. Finally, we achieved the accurate quantification of CTCs in lysed bloods from 12 clinical tumor patients, which exhibited a great promise for further clinical applications.