OAKLAND — No. 9 hitter Zack Gelof’s mighty swing of the bat helped put an end to the A’s nine-game losing streak Tuesday night. Gelof hooked a three-run homer down the left-field line for a 7-2 lead in the fourth inning, then the A’s harrowingly held on for a 7-5 win over the Kansas City Royals.

So began a six-game homestand before an announced Coliseum crowd of 7,013, which paused pregame for a moment of silence to honor the late Willie Mays. Closer Mason Miller came on in the ninth to notch his 13th save, fourth-most in Oakland history by a rookie. Gelof’s 393-foot shot came on a 2-0 slider with no outs, and it chased Royals’ starter Alec Marsh, who took a no-hitter into the seventh in his previous start.

Also scoring on Gelof’s sixth home run of the year were Tyler Nevin and Lawrence Butler, both of whom came up Tuesday from Triple-A Las Vegas to replace veterans Seth Brown (outrighted to Triple-A) and J.D. Davis (designated for assignment).

That roster shakeup wasn’t too surprising in the aftermath of an 0-7 road trip, in which Brown and Davis continued their offensive struggles and reflected the A’s overall woes. The A’s bats promptly came alive upon Tuesday night’s homecoming. They took a 2-0 lead in the first on J.

J. Bleday’s RBI double and Brent Rooker’s sacrifice fly. The Royals pulled even in the next inning on Nick Loftin’s first career home run, to centerfield off A’s starter Hogan Harris.

Another RBI double from Bleday put the A’s .