The Advanced Photon Source at Argonne National Laboratory is developing a low-emittance thermionic gun for a proposed X-ray free-electron laser oscillator (XFEL-O) that will use a laser pulse-heated cathode. The cathode must operate at or slightly above 1500 °C for several nanoseconds and then cool down several hundred °C in approximately the same amount of time, with a 1-MHz heating–cooling cycle. A transient thermal analysis was performed to optimize the laser pulse shape needed to provide the desired temperature response of the cathode for several possible cathode materials. In addition, thermal stresses developed in the cathode during heating–cooling cycles were analysed. Both transient thermal analysis and thermal stress computations were performed using the ANSYS12 code. The computed temperature distribution and thermal stresses were utilized in the optimization of the cathode design. The results of the analysis are presented.