Experimental and theoretical study of core-excited states of Mg II