In cuprate high-temperature superconductors, an antiferromagnetic Mott insulating state can be destabilized toward unconventional superconductivity by either hole- or electron-doping. In addition to these two electronic phases there is now a copious amount of evidence that supports the presence of a charge ordering (CO) instability competing with superconductivity inside the pseudogap state of the hole-doped (p-type) cuprates, but so far there has been no evidence of a similar CO in their electron-doped (n-type) counterparts. Here we report resonant x-ray scattering (RXS) measurements which demonstrate the presence of charge ordering in the n-type cuprate Nd2-xCexCuO4 near optimal doping. Remarkably we find that the CO in Nd2-xCexCuO4 occurs with similar periodicity, and along the same direction, as the CO in p-type cuprates. However, in contrast to the latter, the CO onset in Nd2-xCexCuO4 is higher than the pseudogap temperature, and is actually in the same temperature range where antiferromagnetic fluctuations are first detected -- thereby showing that CO and antiferromagnetic fluctuations are likely coupled in n-type cuprates. Overall our discovery uncovers a missing piece of the cuprate phase diagram and opens a parallel path to the study of CO and its relationship to other phenomena, such as antiferromagnetism (AF) and high-temperature superconductivity.