In an electric valve, an upper surface of a main body portion of a valve body, a cylindrical portion of the valve body, and a flange member form a groove in an annular recess shape. A stator unit includes a tubular portion that surrounds the groove. A sealing member is disposed in the groove and held between the cylindrical portion of the valve body and the tubular portion of the sealing member.