The role of magnetic field and natural convection on the solid–liquid interface motion, flow, and heat transfer during melting of gallium on a vertical wall is reported in this paper. The classical geometry consisting of a rectangular cavity with uniform but different temperatures imposed at two opposite side walls, insulated top, and bottom walls is considered. The magnetic field is imposed in the horizontal direction. A numerical code is developed to solve for natural convection coupled to solid–liquid phase transition and magnetic effects. The corresponding streamlines and isotherms predicted by the numerical model serve to visualize the complicated flow and temperature field. The interplay between the conduction and convection modes of heat transfer stimulated by the combination of the buoyancy-driven flow and the Lorentz force on the fluid due to the magnetic field are studied. The results show that the increase of Rayleigh number promotes heat transfer by convection, while the increase of Hartmann number dampens the strength of circulating convective currents and the heat transfer is then mainly due to heat conduction. These results are applicable in general to electrically conducting fluids and we show that magnetic field is a vital external control parameter in solid–liquid interface motion.