A genetic algorithm was used to optimize performance of a fuzzy inference system acting as a controller for a magnetically actuated CubeSat. A solely magnetically controlled satellite is a nonlinear, underactuated system for which the uncontrollable axis varies as a function of orbit position and attitude; variation is approximately periodic with orbit position. Therefore, controllability is not guaranteed, making solely magnetic control a less than ideal option for spacecraft requiring a high degree of pointing accuracy or spacecraft subject to relatively large disturbances. However, for small spacecraft, such as CubeSats, with modest pointing and disturbance rejection requirements, solely magnetic actuation is a good option. The genetic-algorithm-tuned fuzzy controller solution was compared to a similar linear quadratic regulator solution that was tuned to minimize the cost function used by the genetic algorithm. Both were optimized with respect to a single set of initial conditions. The genetic-algorithm-tuned fuzzy controller was found to be a lower-cost solution than the linear quadratic regulator for the optimized set of initial conditions. Additionally, a Monte Carlo analysis showed the genetic-algorithm-tuned fuzzy controller tended to settle faster than the linear quadratic regulator over a variety of initial conditions.