We report the detection of CoRoT-18b, a massive hot jupiter transiting in front of its host star with a period of 1.9000693 +/- 0.0000028 days. This planet was discovered thanks to photometric data secured with the CoRoT satellite combined with spectroscopic and photometric ground-based follow-up observations. The planet has a mass M_p = 3.47 +/- 0.38 M_Jup, a radius R_p = 1.31 +/- 0.18 R_Jup, and a density rho_p = 2.2 +/- 0.8 g/cm3. It orbits a G9V star with a mass M_* = 0.95 +/- 0.15 M_Sun, a radius R_* = 1.00 +/- 0.13 R_Sun, and a rotation period P_rot = 5.4 +/- 0.4 days. The age of the system remains uncertain, with stellar evolution models pointing either to a few tens Ma or several Ga, while gyrochronology and lithium abundance point towards ages of a few hundred Ma. This mismatch potentially points to a problem in our understanding of the evolution of young stars, with possibly significant implications for stellar physics and the interpretation of inferred sizes of exoplanets around young stars. We detected the Rossiter-McLaughlin anomaly in the CoRoT-18 system thanks to the spectroscopic observation of a transit. We measured the obliquity psi = 20 +/- 20 degrees (sky-projected value: lambda = -10 +/- 20 degrees), indicating that the planet orbits in the same way as the star is rotating and that this prograde orbit is nearly aligned with the stellar equator.