The efficacy and tolerability of systemically administered anticancer agents are limited by their off-target effects. Precise spatiotemporal control over their cytotoxic activity would allow improving chemotherapy treatments, and light-regulated drugs are well suited to this purpose. We have developed phototrexate, the first photoswitchable inhibitor of the human dihydrofolate reductase (DHFR), as a photochromic analogue of methotrexate, a widely prescribed chemotherapeutic drug to treat cancer and psoriasis. Quantification of the light-regulated DHFR enzymatic activity, cell proliferation, and in vivo effects in zebrafish show that phototrexate behaves as a potent antifolate in its photoactivated cis configuration and that it is nearly inactive in its dark-relaxed trans form. Thus, phototrexate constitutes a proof-of-concept to design light-regulated cytotoxic small molecules and a step forward to develop targeted anticancer photochemotherapies with localized efficacy and reduced adverse effects.