A system and method for detection of cells is disclosed. Target cells, such as circulating tumor cells (CTCs), may be of interest. Magnetic beads may be bound to the target cells. After which, the target cells (with the magnetic beads attached thereto) may be identified using an applied magnetic field. In one example, magnetic sensors may be used to detect movement of the target cells responsive to an applied magnetic field. In another example, an optical sensor (such as a camera) may be used to detect movement of the target cells responsive to an applied magnetic field. Further, separate from identification of the target cells, the target cells may be sorted using an applied magnetic field. In this way, a magnetic field may be used in either or both of target cell identification or target cell sorting in order to detect target cells of interest.