Mechanical sensors are essential tools for the detection of small forces. This thesis presents the dc SQUID as a detector for the displacement of embedded micromechanical resonators. The device geometry and basic operating principle are described. The SQUID displacement detector reaches an excellent resolution, a factor of 1.5 below the standard quantum limit: It can detect one-third of a single vibrational quantum in a 129 kHz resonator. We use the high displacement sensitivity to perform feedback cooling of the temperature of the fundamental resonance mode by using a heterodyne discrete-time scheme. The thesis also studies the SQUID backaction: Because of the strong coupling between the SQUID and the resonator, the SQUID exerts forces on the resonator which change the resonator spring constant and damping depending on the current and flux bias of the SQUID. In the final chapter, the entire SQUID is mechanically suspended to form a torsional resonator. In this geometry, the backaction becomes so strong that the resonators goes into self-sustained oscillation. In conclusion, the results in this thesis show that the dc SQUID is an excellent displacement detector for micro-and nanomechanical resonators, but also that the SQUID-resonator interaction strongly influences the resonator dynamics.Quantum NanoscienceApplied Science