It is described an electric machine with permanent magnets, which can function as a high torque and power per mass motor or generator. The machine includes a rotor and a stator. The rotor and the stator have spiral shape, the stator is located inside the rotor. The rotor contains at least two permanent magnets of different polarity, forming spirals around the stator. The stator contains a ferromagnetic core, on which the three-phase winding is spirally wound. This construction allows almost the entire winding to participate in torque generation. The cooling with a fluid medium inside the magnet core allows to remove heating from the entire length of the winding, which significantly increases the operating efficiency.