The mechanism of action of temozolomide involves the methylation of DNA at the O6 and N7 positions of guanine. This methylation damages the DNA and triggers cell death, particularly in rapidly dividing cells such as cancer cells. The drug is able to cross the blood-brain barrier, making it particularly effective against brain tumors.