Welington Castillo atoned for an error with a two-run homer in the eighth inning, and the Chicago White Sox rallied to beat the Kansas City Royals 5-4 on Monday night.

Castillo’s poor throw on Billy Hamilton’s steal in the seventh helped set up Whit Merrifield’s tiebreaking sacrifice fly. But Castillo came up big after Tim Anderson led off the eighth with a double against Brad Boxberger (0-3), sending an opposite-field drive to right for his first homer of the season.

Manny Banuelos (1-0) pitched three hitless innings for his first win since 2015, and Alex Colome worked the ninth for his fourth save in four chances and No. 100 for his career.

Anderson had three hits and scored twice, lifting his average to a major league-leading .453.

The White Sox returned home with a little momentum after taking two of three from the Yankees in New York over the weekend.

Hunter Dozier and Chris Owings homered for Kansas City, which was coming off a three-game sweep of Cleveland, the AL Central favorites.

Dozier put Kansas City in front when he drove Ervin Santana’s first pitch of the second over the wall in center for his fourth homer. After Ryan O’Hearn flied out, Lucas Duda worked the first of his three walks and Owings connected for his first homer of the season, giving the Royals a 3-0 lead.

Dozier also doubled in the third for his fifth consecutive multihit game, one day after he singled in the winning run in Kansas City’s 9-8 victory over Cleveland. He is batting .522 (12 for 23) with three homers and five RBIs in his last six games.

Heath Fillmyer cruised into the fifth for Kansas City but came unglued a bit after Chicago had two successful replay challenges. The second one overturned an inning-ending double play and got the White Sox on the board, with Anderson scoring from second on Yolmer Sanchez’s grounder to second.

Leury Garcia then doubled in Sanchez and Yoan Moncada dumped a tying RBI single into right field. The White Sox had a chance for more after Fillmyer hit Jose Abreu with a pitch, but Yonder Alonso flied out to end the inning.