An electric machine (1) with integrated electronics operating as electric motor-generator in electrically powered systems has a motor portion (11) with a plurality of coils (10) so connected, to form a number of isolated winding sections (12) with multi-phase configuration, which are substantially identical between each other. An inverter portion (2) has a plurality of power switching elements (5, 6) forming a power stage with a number of half bridge legs (18). Output connectors (7) of said half bridge legs (18) are electrically connected to terminals (13) of individual coils (10). A control board in an ECU of the inverter portion (2) provides such a control algorithm and signals for power switching, that the coils (10) which belong to the same phase of the motor (1) have the same terminal voltages. Current sensors (8, 9) for measuring the motor phase currents are so arranged to measure the currents through only two coils (10) from the plurality of coils (10) in the stator(17). The size, the measuring range ofcurrent sensors (8, 9) and unwanted braking torque during faults in motor windings orin power switches arereduced by the number of isolated winding sections (12). Therefore the motor-generator (1) becomes more compact and has a higher functional safety.