According to one embodiment, a magnetoresistive element includes a first magnetic layer including O and one of Co, Fe, Ni and Mn, a second magnetic layer, a nonmagnetic layer between the first and second magnetic layers, a first electrode connected to the first magnetic layer, a second electrode connected to the second magnetic layer, and a resistive layer including N between the first magnetic layer and the first electrode.