According to an embodiment, a pressure sensor includes a substrate, a support part, a flexible membrane part, and a magnetoresistive element. The support part is adhered on the substrate by using a first adhesive material with a first Youngs modulus and a second adhesive material with a second Youngs modulus different from the first Youngs modulus. The membrane part is supported by the support part. The magnetoresistive element is provided on the membrane part, and includes a first magnetic layer, a second magnetic layer, and a spacer layer provided between the first magnetic layer and the second magnetic layer.