Context. With about 2000 extrasolar planets confirmed, the results show that planetary systems have a whole range of unexpected properties. This wide diversity provides fundamental clues to the processes of planet formation and evolution. Aims. We present a full investigation of the HD 219828 system, a bright metal-rich star for which a hot Neptune has previously been detected. Methods. We used a set of HARPS, SOPHIE, and ELODIE radial velocities to search for the existence of orbiting companions to HD 219828. The spectra were used to characterise the star and its chemical abundances, as well as to check for spurious, activity induced signals. A dynamical analysis is also performed to study the stability of the system and to constrain the orbital parameters and planet masses. Results. We announce the discovery of a long period (P = 13.1 yr) massive (m sin i = 15.1 M Jup ) companion (HD 219828 c) in a very eccentric orbit (e = 0.81). The same data confirms the existence of a hot Neptune, HD 219828 b, with a minimum mass of 21 M â and a period of 3.83 days. The dynamical analysis shows that the system is stable, and that the equilibrium eccentricity of planet b is close to zero. Conclusions. The HD 219828 system is extreme and unique in several aspects. First, ammong all known exoplanet systems it presents an unusually high mass ratio. We also show that systems like HD 219828, with a hot Neptune and a long-period massive companion are more frequent than similar systems with a hot Jupiter instead. This suggests that the formation of hot Neptunes follows a different path than the formation of their hot jovian counterparts. The high mass, long period, and eccentricity of HD 219828 c also make it a good target for Gaia astrometry as well as a potential target for atmospheric characterisation, using direct imaging or high-resolution spectroscopy. Astrometric observations will allow us to derive its real mass and orbital configuration. If a transit of HD 219828 b is detected, we will be able to fully characterise the system, including the relative orbital inclinations. With a clearly known mass, HD 219828 c may become a benchmark object for the range in between giant planets and brown dwarfs.