The dayside atmospheres of ultra-hot Jupiters (UHJs) are predicted to possess temperature inversion layers with extremely high temperatures at high altitudes. We observed the dayside thermal emission spectra of WASP-18b and WASP-76b with the new CRIRES + high-resolution spectrograph at near-infrared wavelengths. Using the cross-correlation technique, we detected strong CO emission lines in both planets, which confirms the existence of temperature inversions on their dayside hemispheres. The two planets are the first UHJs orbiting F-type stars with CO emission lines detected; previous detections were mostly for UHJs orbiting A-type stars. Evidence of weak H 2O emission signals is also found for both planets. We further applied forward-model retrievals on the detected CO lines and retrieved the temperature-pressure profiles along with the CO volume mixing ratios. The retrieved logarithmic CO mixing ratio of WASP-18b (−2.2 −1.5 +1.4) is slightly higher than the value predicted by the self-consistent model assuming solar abundance. For WASP-76b, the retrieved CO mixing ratio (−3.6 −1.6 +1.8) is broadly consistent with the value of solar abundance. In addition, we included the equatorial rotation velocity ( υ eq) in the retrieval when analyzing the line profile broadening. The obtained υ eq is 7.0 ± 2.9 km s −1 for WASP-18b and 5.2 −3.0 +2.5 km s −1 for WASP-76b, which are consistent with the tidally locked rotational velocities.