Mechlorethamine functions by alkylating the DNA of rapidly dividing cells. Specifically, it forms covalent bonds with the guanine bases in DNA, leading to cross-linking of DNA strands. This cross-linking prevents the DNA from uncoiling and replicating, thereby inhibiting cell division. As a result, the cancer cells undergo apoptosis, or programmed cell death. This mechanism of action is common among other alkylating agents used in chemotherapy.