A motor-driven compressor comprising: a rotary shaft; an electric motor including a stator and a rotor, the electric motor rotating the rotary shaft; a compression portion, which is driven by rotation of the rotary shaft and compresses a refrigerant; a motor driving circuit, which drives the electric motor; a housing, which accommodates the electric motor, the compression portion, and the motor driving circuit; a connecting terminal, which electrically connects the electric motor to the motor driving circuit; and a cluster block, which accommodates the connecting terminal, wherein the stator includes a stator core, which includes a tubular core base and a plurality of teeth extending in a radial direction from the core base, characterized by an insulator (31, 32) including a tubular base, which contacts an end surface of the core base, a plurality of extended portions, which extend from the base in the radial direction and contact the teeth, and an insulator flange, which is located at an opposite end of each extended portion from the base and projects in an opposite direction from the stator core, and a coil formed by winding a conducting wire around each tooth and the associated extended portion, wherein the insulator flange is configured to contact the coil to prevent the coil from moving radially inward, the cluster block is fastened to at least a pair of the insulator flanges on an opposite side of the insulator flanges from the extended portions, wherein the insulator flanges comprise edges that are adjacent to each in circumferential direction, parallel to each another and extend in axial direction of the base, the cluster block includes an opposed surface facing some of the insulator flanges in a radial direction of the rotary shaft, the opposed surface includes an engagement piece, which projects in the radial direction of the rotary shaft, and the engagement piece is fitted to an opening portion in the axial direction of the rotary shaft, wherein the opening portion is a gap between the edges of the insulator flanges that are adjacent to one another in circumferential direction. a rotary shaft; an electric motor including a stator and a rotor, the electric motor rotating the rotary shaft; a compression portion, which is driven by rotation of the rotary shaft and compresses a refrigerant; a motor driving circuit, which drives the electric motor; a housing, which accommodates the electric motor, the compression portion, and the motor driving circuit; a connecting terminal, which electrically connects the electric motor to the motor driving circuit; and a cluster block, which accommodates the connecting terminal, wherein the stator includes a stator core, which includes a tubular core base and a plurality of teeth extending in a radial direction from the core base, characterized by an insulator (31, 32) including a tubular base, which contacts an end surface of the core base, a plurality of extended portions, which extend from the base in the radial direction and contact the teeth, and an insulator flange, which is located at an opposite end of each extended portion from the base and projects in an opposite direction from the stator core, and a coil formed by winding a conducting wire around each tooth and the associated extended portion, wherein the insulator flange is configured to contact the coil to prevent the coil from moving radially inward, the cluster block is fastened to at least a pair of the insulator flanges on an opposite side of the insulator flanges from the extended portions, wherein the insulator flanges comprise edges that are adjacent to each in circumferential direction, parallel to each another and extend in axial direction of the base, the cluster block includes an opposed surface facing some of the insulator flanges in a radial direction of the rotary shaft, the opposed surface includes an engagement piece, which projects in the radial direction of the rotary shaft, and the engagement piece is fitted to an opening portion in the axial direction of the rotary shaft, wherein the opening portion is a gap between the edges of the insulator flanges that are adjacent to one another in circumferential direction.