Mitochondria organize their genome in protein-DNA complexes called nucleoids. The mitochondrial transcription factor A (TFAM), a protein that regulates mitochondrial transcription, is abundant in these nucleoids. TFAM is believed to be essential for mitochondrial DNA compaction, yet the exact mechanism has not been resolved. Here we use a combination of single-molecule manipulation and fluorescence microscopy to show the nonspecific DNA-binding dynamics and compaction by TFAM. We observe that single TFAM proteins diffuse extensively over DNA (sliding) and, by collisions, form patches on DNA in a cooperative manner. Moreover, we demonstrate that TFAM induces compaction by changing the flexibility of the DNA, which can be explained by local denaturation of the DNA (melting). Both sliding of TFAM and DNA melting are also necessary characteristics for effective, specific transcription regulation by TFAM. This apparent connection between transcription and DNA organization clarifies how TFAM can accomplish two complementary roles in the mitochondrial nucleoid at the same time.