A scheme to generate magnetized relativistic plasmas in a laboratory setting is proposed. It is based on the interaction of ultra-high-intensity sub-picosecond laser pulses with few-micron-thick foils or films. By means of Particle-In-Cell simulations, it is shown that energetic electrons produced by the laser and evacuated at the rear of the target trigger an expansion of the target, building up a strong azimuthal magnetic field. It is shown that in the expanding plasma sheath, a ratio of the magnetic pressure and the electron rest-mass energy density exceeds unity, whereas the plasma pressure is lower than the magnetic pressure and the electron gyroradius is lower than the plasma dimension. This scheme can be utilized to study astrophysical extreme phenomena such as relativistic magnetic reconnection in laboratory.