Production of a halogen-containing metal layer on a substrate comprises depositing an educt containing up to 0.1 atom.% halogen in the gas phase in a halogen-containing atmosphere onto the substrate or producing the halogen-containing layer on the substrate in a sputtering process using a halogen- and aluminum-containing target. An independent claim is also included for a halogen-containing metal layer on a substrate.