A motor-driven compressor, comprising: a compression mechanism for compressing refrigerant; an electric motor for driving the compression mechanism; a compressor housing made of a metal and accommodating therein the compression mechanism and the electric motor, the compressor housing formed with a through-hole; a conductive member extending through the through-hole and electrically connected to the electric motor; a terminal base disposed in the through-hole; an insulating member supporting the conductive member on the terminal base while insulating the conductive member from the terminal base; a connecting terminal electrically connected to the conductive member; an electric wire for electrically connecting the connecting terminal and the electric motor; and a terminal housing made of an electrically insulating material and accommodating therein an electrical connecting portion which includes the connecting terminal connecting to the conductive member and the electric wire, the terminal housing having a first hole through which the conductive member is inserted and a second hole through which the electric wire is inserted, characterized in that the compressor further comprises a first seal member and a second seal member, the first seal member is provided between the terminal housing and the insulating member to seal the inside of the terminal housing from the outside thereof, the second seal member is provided between the second hole and the electric wire to seal the inside of the terminal housing from the outside thereof, the terminal housing has a distance-increasing portion that increases the communicating distance from the compressor housing to the electrical connecting portion in the terminal housing, and the distance-increasing portion allows the pressures in the terminal housing and the compressor housing to be equalized. a compression mechanism for compressing refrigerant; an electric motor for driving the compression mechanism; a compressor housing made of a metal and accommodating therein the compression mechanism and the electric motor, the compressor housing formed with a through-hole; a conductive member extending through the through-hole and electrically connected to the electric motor; a terminal base disposed in the through-hole; an insulating member supporting the conductive member on the terminal base while insulating the conductive member from the terminal base; a connecting terminal electrically connected to the conductive member; an electric wire for electrically connecting the connecting terminal and the electric motor; and a terminal housing made of an electrically insulating material and accommodating therein an electrical connecting portion which includes the connecting terminal connecting to the conductive member and the electric wire, the terminal housing having a first hole through which the conductive member is inserted and a second hole through which the electric wire is inserted, characterized in that the compressor further comprises a first seal member and a second seal member, the first seal member is provided between the terminal housing and the insulating member to seal the inside of the terminal housing from the outside thereof, the second seal member is provided between the second hole and the electric wire to seal the inside of the terminal housing from the outside thereof, the terminal housing has a distance-increasing portion that increases the communicating distance from the compressor housing to the electrical connecting portion in the terminal housing, and the distance-increasing portion allows the pressures in the terminal housing and the compressor housing to be equalized.