Huge magnetic fields are predicted to exist in the high-density region of plasmas produced during intense laser-matter interaction, near the critical-density surface where most laser absorption occurs, but until now these fields have never been measured. By using pulses focused to extreme intensities to investigate laser-plasma interactions, we have been able to record the highest magnetic fields ever produced in a laboratory--over 340 megagauss--by polarimetry measurements of self-generated laser harmonics.