We evaluate the prompt electromagnetic signatures of the merger between a massive close-in planet (a 'hot Jupiter') and its host star, events with an estimated Galactic rate of ∼0.1-1 yr −1 . Depending on the ratio of the mean density of the planetρ p to that of the starρ , a planet-star merger results in three possible outcomes. Ifρ p /ρ 5, then the planet directly plunges below the stellar atmosphere before being disrupted by tidal forces. The dissipation of orbital energy creates a hot wake behind the planet, producing a extreme ultraviolet (EUV)/soft X-ray transient that increases in brightness and temperature as the planet sinks below the stellar surface. The peak luminosity L EUV/X 10 36 erg s −1 is achieved weeks to months prior to merger, after which the stellar surface is enshrouded by an outflow driven by the merger. The final stages of the inspiral are accompanied by an optical transient powered by the recombination of hydrogen in the outflow, which peaks at a luminosity of ∼10 37 -10 38 erg s −1 on a time-scale ∼days.If the star is instead significantly denser (ρ p /ρ 5), then the planet overflows its Roche lobe above the stellar surface. Forρ p /ρ 1 mass transfer is stable, resulting in the planet being accreted on the relatively slow time-scale set by tidal dissipation. However, for an intermediate-density range 1 ρ p /ρ 5 mass transfer may instead be unstable, resulting in the dynamical disruption of the planet into an accretion disc around the star. Outflows from the super-Eddington accretion disc power an optical transient with a peak luminosity of ∼10 37 -10 38 erg s −1 and characteristic duration ∼week-months. Emission from the disc itself becomes visible once the accretion rate decreases below the Eddington rate, resulting in a bolometric brightening and shift of the spectral peak to ultraviolet (UV) wavelengths. Optical transients from both direct-impact merger and tidal-disruption events in some ways resemble classical novae, but can be distinguished by their higher ejecta mass and lower velocity around hundreds of km s −1 , and by hard pre-and post-cursor emission, respectively. The most promising search strategy is with combined surveys of nearby massive galaxies (e.g. M31) at optical, UV and X-ray wavelengths with cadences from days to months.