A 19-element piezoelectric deformable mirror has been used as a rear intracavity mirror to adaptively optimize the mode of a flash lamp-pumped continuous-wave solid-state laser. A closed-loop adaptive global genetic algorithm is adopted to search the optimum voltages which are used to control the deformable mirror. A series of experiments have been accomplished and results showed that it is efficient to use such a piezoelectric deformable mirror to compensate the thermal effects in the laser resonators and can successfully change TEM11, TEM10,TEM20 transverse modes into fundamental TEM00 mode. Further more, the output laser powers can also be optimized automatically. (c) 2007 Elsevier B.V. All rights reserved.