We describe experimental results with a diode-pumped, passively Q-switched extracavity second- and third-harmonic generation. Cr:YAG is used as a saturable absorber for pulse generation. Taking into account the thermal effects of Nd:YAG at high incident pump power, we use a short plane-to-plane cavity configuration to take advantage of the maximum pump power and obtain the compactness structure. At the same time, we use the type-I critical phase-matched lithium triborate crystal to generate light at 532 nm and mix the residual fundamental at 1064 nm and the second-harmonic wave at 532 nm in the type-II critical phase-matched lithium triborate crystal for UV light generation at 355 nm. A third-harmonic-generation output power of 1.32 W is achieved at the incident pump power of 27.5 W, corresponding to an optical-to-optical efficiency of 4.8%. The instability of the UV laser power is less than 5% for 4 h.