The photochemistry of N-methylformamide (MF) is elucidated by investigating its photodissociation products generated by UV irradiation (248 nm) in an argon matrix (10 K). We find that, starting from trans-MF, prolonged irradiation produces cis-MF, CH3NH2 and CO fragments as major products. Another photoproduct is identified as methylformimidic acid (FIA). Nonadiabatic dynamics simulations starting from both MF conformers revealed that the internal conversion occurs within 1 ps through a CN dissociation channel. The major product is a weakly bound complex between CH3NH and HCO radicals. This complex owes its existence to the cage effect of the matrix which allows for H-transfer reactions and recombination. By identifying the primary photoisomerization and photodissociation pathways of MF, we gain new insights into the photochemistry of peptide bonds in general, which is a prerequisite for a better understanding of the effect of UV irradiation on living systems.