Method for control of a vehicle with a drive system comprising an output shaft in a combustion engine, a first electrical machine, comprising a stator and a rotor, a planetary gear comprising three components in the form of a sun wheel, a ring gear and a planetary wheel carrier, wherein the combustion engine's output shaft is connected with a first of said components in the planetary gear, so that a rotation of such shaft leads to a rotation of such component, wherein an output shaft of the planetary gear is connected with a second of said components in the planetary gear, for transmission of torque for the propulsion of the vehicle, so that a rotation of such shaft leads to a rotation of such component, and the electrical machine's rotor is connected with a third of said components in the planetary gear, so that a rotation of the rotor leads to a rotation of this component, wherein the drive system also comprises a first locking means, which may be moved between a locked position in which two of said components are locked together so that the three components rotate with the same rotational speed, and a release position in which the components are allowed to rotate at different rotational speeds, wherein the control is implemented for a vehicle, whose drive system also comprises a second electrical machine with a stator and a rotor, connected with the output shaft of the combustion engine, between the combustion engine and said first component, and a second locking means, which may be moved between a locked position in which the combustion engine's output shaft is locked together with the second electrical machine's rotor and said first component, and a release position in which the combustion engine's output shaft is disconnected from the second electrical machine's rotor and said first component, and is allowed to rotate independently of these, and at least one electrical energy storage means for exchange of electric power with the first and second electrical machine, and characterised in that the method comprises the following steps for turning off of the combustion engine and transitioning to operation of the vehicle with the electrical machines (9, 30), while the vehicle is driven with the combustion engine running: a) ensuring that the first locking means is in a release position, b) controlling the first electrical machine to achieve, throughout the progress of the entire method, a requested torque for transmission to said output shaft of the planetary gear, c) controlling the second electrical machine and the combustion engine towards and up to a synchronous rotational speed of the second electrical machine's rotor and the combustion engine's output shaft, d) shifting of the second locking means to a locked position, when said synchronous rotational speed has been achieved, e) cessation of injection of fuel into the combustion engine, f) controlling the rotational speed of the second electrical machine, towards and until a standstill, and g) moving the second locking means to the release position, wherein the steps c) and d) are skipped, if the second locking means are in the locked position when the method is started. a) ensuring that the first locking means is in a release position, b) controlling the first electrical machine to achieve, throughout the progress of the entire method, a requested torque for transmission to said output shaft of the planetary gear, c) controlling the second electrical machine and the combustion engine towards and up to a synchronous rotational speed of the second electrical machine's rotor and the combustion engine's output shaft, d) shifting of the second locking means to a locked position, when said synchronous rotational speed has been achieved, e) cessation of injection of fuel into the combustion engine, f) controlling the rotational speed of the second electrical machine, towards and until a standstill, and g) moving the second locking means to the release position,