A magnetoresistive element is disclosed that includes a magnetoresistive
film; a cap film configured to cover the magnetoresistive film and
include a three-layer structure in at least a part thereof, the
three-layer structure being formed of a third protection layer, a second
protection layer, and a first protection layer in order from the
magnetoresistive film side; and upper and lower terminals for applying a
sense current perpendicularly to the surface of the magnetoresistive
film. The magnetoresistive film includes a first magnetic layer whose
direction of magnetization is changed by an external magnetic field, a
second magnetic layer whose direction of magnetization is fixed with
respect to the external magnetic field, and a nonmagnetic layer
magnetically separating the first magnetic layer and the second magnetic
layer.