Nitrogen mustard works by alkylating the DNA of rapidly dividing cells, causing cross-links and breaks in the DNA strands. This interferes with the cancer cells' ability to replicate and ultimately leads to cell death. Because of this mechanism, nitrogen mustards are classified as alkylating agents.