Quasi-phase-matched (QPM) UV second-harmonic generation (SHG) in a periodically poled MgO:LiNbO3 waveguide is presented. A ridge-type waveguide with high nonlinearity and strong resistance to photorefractive damage was achieved by use of an ultraprecision machining technique. By use of this waveguide in 1.4-microm periodically poled MgO:LiNbO3, a first-order QPM SHG device for 340-nm UV radiation was demonstrated. In a single-pass configuration, continuous-wave 22.4-mW UV light was generated for a fundamental power of 81 mW, corresponding to a normalized conversion efficiency of 340%/W.