Hot Jupiters are gas-giant planets orbiting with periods of 3-9 days around Sun-like stars. They are believed to form in a disk of gas and condensed matter at or beyond ~2.7 astronomical units (AU-the Sun-Earth distance) from their parent star. At such distances, there exists a sufficient amount of solid material to produce a core capable of capturing enough gas to form a giant planet. Subsequently, they migrate inward to their present close orbits. Here I report the detection of an unusual hot Jupiter orbiting the primary star of a triple stellar system, HD 188753. The planet has an orbital period of 3.35 days and a minimum mass of 1.14 times that of Jupiter. The primary star's mass is 1.06 times that of the Sun, 1.06Msolar. The secondary star, itself a binary stellar system, orbits the primary at an average distance of 12.3AU with an eccentricity of 0.50. The mass of the secondary pair is 1.63Msolar. Such a close and massive secondary would have truncated a disk around the primary to a radius of only ~1.3AU (ref. 4) and might have heated it up to temperatures high enough to prohibit giant-planet formation, leaving the origin of this planet unclear.