UPDATE/CORRECTION: The original reference for the result asked about is the following 1968 paper of Jensen and Solovay (and the credit goes to Jensen, as explained below).
Jensen, R. B and Solovay, R. M., Some applications of almost disjoint sets. Mathematical Logic and Foundations of Set Theory (Proc. Internat. Colloq., Jerusalem, 1968), pp. 84–104.
MORE DETAIL: The method of eliminating the Mahlo property while preserving strong inaccessibility invented in the above paper was generalized in the following paper of William Boos (the paper is based on his doctoral dissertation at the University of Wisconsin, written under the direction of Kenneth Kunen).
William Boos, Boolean Extensions which Efface the Mahlo Property, The Journal of Symbolic Logic, Vol. 39, No. 2 (Jun., 1974), pp. 254-268.
The first paragraph of the MathSciNet review (by Frank Drake) of the above paper of Boos reads as follows (the bold font is my own enhancement).
The author presents four forcing constructions (equivalently: complete Boolean algebras), all concerned with altering the Mahlo properties of a cardinal, and stemming in the first place from a construction of Jensen [see R. B. Jensen and R. M. Solovay, Some applications of almost disjoint sets, Mathematical logic and foundations of set theory/ (Proc. Internat. Colloq., Jerusalem, 1968), pp. 84–104, North Holland, Amsterdam, 1970; MR0289291]. Jensen's construction took a strongly Mahlo cardinal and (in the generic extension) destroyed the Mahlo property while leaving the cardinal still strongly inaccessible. The first of the author's constructions is a generalization of this, and takes a cardinal $\kappa$ that is strongly $\kappa$-Mahlo, and an ordinal $\alpha<\kappa$, and makes $\kappa$ strongly $\alpha$-Mahlo but not $\alpha + 1$-Mahlo in the extension. The second combines the first with an Easton-type argument to make $\kappa$ the first strongly $\alpha + 1$-Mahlo cardinal.