The present invention relates to a resin composition containing (A) a compound having a maleimide group, a divalent group having at least two imide bonds, and a saturated or unsaturated divalent hydrocarbon group and (B) a halogen-free flame retardant.