The single-phase sample of MgB2 was prepared successfully at the temperature of 900℃ and under the pressure of 3 GPa. The structure of the sample was investigated using powder X-ray diffraction and Rietveld analysis. The results show that the structure of the sample belongs to the hexagonal structure with space group of P6/mmm, a=3.0861(5) A, c=3.5222(8) A. The magnetic and resistance measurements indicate that the superconducting transition temperature Tc is 39 K.