Does Magnesium oxide have ionic or covalent bonds?

Magnesium oxide has ionic bonds because it is between a Metal (Mg) and a Nonmetal (O) and Magnesium offers 2 of its electrons to Oxygen in order for Oxygen to form a full Octet (8 electrons in the valence).