We report the discovery of the planet XO-4b, which transits the star XO-4 (GSC 03793-01994, V=10.7, F5V). Transits are 1.0% deep and 4.4 hours in duration. The star XO-4 has a mass of 1.32 M_sun.... The planet XO-4b has a mass of 1.72 M_Jup....radius of 1.34 R_Jup...orbital period 4.125 days. We analyze scintillation-limited differential R-band photometry of XO-4b in transit made with a 1.8-m telescope under photometric conditions, yielding photometric precision of 0.6 to 2.0 millimag per one-minute interval. The declination of XO-4 places it within the continuous viewing zone of the Hubble Space Telescope (HST), which permits observation without interruption caused by occultation by the Earth. Because the stellar rotation periods of the three hottest stars orbited by transiting gas-giant planets are 2.0, 1.1, and 2.0 times the planetary orbital periods, we note the possibility of resonant interaction.