Results of molecular dynamics simulations of water freezing in contact with an ice layer and of brine rejection from freezing salt solutions are reported. Expulsion of salt ions from the freezing part of the system is described with atomic resolution and the molecular mechanism of this atmospherically and technologically very important process is discussed.