Method for electrochemical deposition of a metal coating on a metal substrate using an ionic liquid as the electrolyte, which substrate comprises a first metallic element which is the main component of said substrate and said coating being mainly composed of a coating material, said coating material comprising a second metallic element, wherein said substrate is a steel substrate and the first metallic element is iron (Fe),and wherein the second metallic element is chromium (Cr), which method comprises the steps of: - pretreating the substrate surface by subjecting the substrate to electrochemical etching in an ionic liquid, which ionic liquid contains metal ions of the second metallic element, during said etching removing metal ions of the first metallic element from the substrate, which metal ions of the first metallic element are received by the ionic liquid, which ionic liquid is a mixture consisting of or comprising choline chloride and CrCl3.6H2O, wherein the electrochemical etching takes place by applying a voltage difference between the substrate and a counter-electrode, being submerged together with the substrate in a bath of the electrolyte, - depositing a transition layer on the substrate by electrochemical deposition from said ionic liquid, which ionic liquid contains metal ions of the first metallic element that were removed from the substrate during the step of the etching and metal ions of the second metallic element, both metal ions from the first metallic element and metal ions of the second metallic element being incorporated in the transition layer that is deposited on the substrate, wherein the substrate is submerged together with a counterelectrode in said ionic liquid and an external voltage is applied between the substrate and the counter-electrode, resulting in the electrodeposition of a metal coating, - depositing the coating on the transition layer by electrochemical deposition from an ionic liquid containing ions of the second metallic element, wherein the substrate is submerged together with a counterelectrode in said ionic liquid and an external voltage is applied between the substrate and the counter-electrode, resulting in the electrodeposition of a metal coating, wherein a flow of ionic liquid is provided over the surface of the substrate during the deposition of the transition layer and during the deposition of the coating, wherein the velocity of the flow relative to the surface of the substrate is less than 1 m/s - pretreating the substrate surface by subjecting the substrate to electrochemical etching in an ionic liquid, which ionic liquid contains metal ions of the second metallic element, during said etching removing metal ions of the first metallic element from the substrate, which metal ions of the first metallic element are received by the ionic liquid, which ionic liquid is a mixture consisting of or comprising choline chloride and CrCl3.6H2O, wherein the electrochemical etching takes place by applying a voltage difference between the substrate and a counter-electrode, being submerged together with the substrate in a bath of the electrolyte, - depositing a transition layer on the substrate by electrochemical deposition from said ionic liquid, which ionic liquid contains metal ions of the first metallic element that were removed from the substrate during the step of the etching and metal ions of the second metallic element, both metal ions from the first metallic element and metal ions of the second metallic element being incorporated in the transition layer that is deposited on the substrate, wherein the substrate is submerged together with a counterelectrode in said ionic liquid and an external voltage is applied between the substrate and the counter-electrode, resulting in the electrodeposition of a metal coating, - depositing the coating on the transition layer by electrochemical deposition from an ionic liquid containing ions of the second metallic element, wherein the substrate is submerged together with a counterelectrode in said ionic liquid and an external voltage is applied between the substrate and the counter-electrode, resulting in the electrodeposition of a metal coating,