Simultaneous genetic improvements in grain yield and heat stress tolerance are necessary to avoid a fall in crop yields caused by global warming during the 21st century. Future food security depends on crop breeding solutions to this challenge, especially in developing countries where the need is greatest. We stochastically model a wheat breeding program during 60 years of rapid global warming based on rapid two-year cycles, with selection in early generations for heat stress tolerance, grain yield, disease resistance and stem strength. In each cycle, breeding values were estimated by best linear unbiased prediction (BLUP) using all pedigree and phenotypic information (including selfing) back to the founders. We compared two methods of selection and mating design with similar costs. The first method was truncation selection for heat stress tolerance to match predicted increases in land temperatures followed by selection for an economic index composed of weighted estimated breeding values for each trait, followed by random pair-wise mating among selections. The second method was optimal contributions selection (OCS) for the economic index with an overriding constraint to increase heat stress tolerance in each cycle to match global warming trends, and mating prescribed by OCS. Truncation selection caused a rapid loss of genetic diversity, and heat stress tolerance did not keep pace with global warming. Consequently, grain yield began to decline due to heat stress before 60 years. With OCS, heat stress tolerance matched global warming trends, the economic index almost tripled and grain yield nearly doubled during 60 years of global warming. OCS on an economic index, with a priority to meet heat stress tolerance, increased grain yields and avoided a major threat to global food security caused by global warming.