The Mariners right-hander hasn't lost four straight starts since 2008. He also left in the seventh inning with a cramp in his lower back.
Smith (2-1) pitched 4 1-3 innings of scoreless relief to pick up the victory, allowing just one hit, after starter Danny Duffy failed to make it through four innings. Five of Smith's strikeouts took only three pitches.
Greg Holland pitched a one-hit ninth for his 37th save in 39 opportunities.
The Royals broke a 1-all tie with a two-run fifth, which Jarrod Dyson led off with an infield single and advanced to third on Alcides Escobar's hit-and-run single to right. Dyson scored on a Hernandez wild pitch. Escobar scored on Emilo Bonifacio's sacrifice fly.
Hernandez (12-9), who was 0-3 with a 9.64 ERA in his previous three starts, exited while pitching to Alex Gordon with two out in the seventh.
Duffy, who had elbow surgery last year, departed after 3 2-3 innings and 91 pitches. Duffy allowed one run on five hits and four walks, while striking out four before being replaced by Will Smith.
Brad Miller's two-out triple in the fourth scored Abraham Almonte, who had doubled.
Hernandez, however, could not hold the lead. He gave up three consecutive hits with one out in the fourth with Mike Moustakas' single bringing home Eric Hosmer.
Duffy threw 68 pitches in the first three innings and stranded six runners. He struck out Kendrys Morales and Justin Smoak swinging to end the first with two runners on base.
Michael Saunders led off the second with a bunt single and Duffy walked Mike Zunino on nine pitches before retiring the next three batters.
Nick Franklin walked to start the third and Nick Seager, who had three hits, singled to center, but Duffy rebounded to strike out Morales and retired Smoak and Saunders on fly balls to left.
NOTES: Zunino was activated from the disabled list after five rehab games with Triple-A Tacoma. He went on the disabled list July 26 with a broken left wrist. . Carlos Pena, whom the Royals signed to a minor league contract last week, went 3-for-4 with a home run and four RBIs as Triple-A Omaha beat Round Rock Monday to clinch the Pacific Coast League North Division championship. . RHP Erasmo Ramirez will be added to the Mariners roster Tuesday and start against the Royals. This will be his 10th Seattle start this season and 17th career start.