KANSAS CITY, Mo. — A bad start doesn't necessarily lead to a bad ending, as James Shields proved Thursday in the White Sox opener.

Lucas Giolito hasn't experienced many bad starts in his brief time with the Sox. He pitched into the sixth inning in all but one of his seven starts in 2017 and allowed one run or fewer in four of them.

In his first start of the 2018 season Saturday night against the Royals, the 23-year-old righty battled control problems but pushed his way through them. Giolito struck out only one, walked four and allowed four hits before turning the game over to the bullpen after six innings with the Sox trailing 3-1.

But the Sox rallied with three runs in the eighth and held on for a 4-3 victory, their first of the season.

Matt Davidson staked Giolito to an early lead with a one-out RBI single to right in the first inning. That scored Yoan Moncada, who led off with a walk and went to third on Avi Garcia's single. But that was all the Sox could manage, though they did force Royals starter Ian Kennedy to throw 35 pitches to retire the side.

Each of the first four batters Giolito faced in the bottom of the inning reached base. Single. Hit by pitch. Walk. Another walk to cleanup hitter Lucas Duda, scoring a run. Cheslor Cuthbert's sacrifice fly brought home a second run before Giolito got Paolo Orlando to hit into an inning-ending double play.

Giolito was touched for another run in the third. After Mike Moustakas clubbed a two-out triple, Duda knocked him in with a single to make it 3-1. Giolito allowed the first two Royals to reach in the fifth, then retired the 3-4-5 hitters to squash the threat. His final inning was a three-up, three-down sixth.

Moncada led off the 8th inning with a 433-foot home run to right-center off reliever Brandon Maurer to pull the Sox within a run. Later in the inning, Welington Castillo's two-out, two-run double gave the Sox the lead.

Danny Farquhar relieved Giolito and set the Royals down in order in the 7th. Nate Jones worked a scoreless 8th, striking out two.

Joakim Soria, in his first appearance with the Sox, allowed a leadoff single and a walk in the ninth but got out of trouble to earn the save.

For a veteran such as Shields, overcoming adversity is how you survive 12 seasons in the major leagues. The 36-year-old Shields has had his share of rough outings, especially in his time with the Sox, but he demonstrated the value of resiliency in his Opening-Day start. After getting tagged for five hits and four runs in the first, Shields regrouped to retire 18 of the last 21 batters he faced and hung around long enough to get the win.

"He was upset at himself after that first inning," Sox manager Rick Renteria said. "But he's been around the block. Baseball is a game that allows you the opportunity to redeem yourself, if not after every pitch, after every inning, after every out. He did a nice job of settling down and keeping us in the game and allowing the guys to kind of chip away."

Shields' gutty performance served as an example for Giolito, and the lesson was not lost on their manager either.

"Young guys can understand that you don't have to start off at your best to give yourself a chance to win the ballgame," Renteria said, "and that's what (Shields) did."

And that's what Giolito did Saturday night.

Snow is in the forecast here for Sunday's 1:15 p.m. game, when Reynaldo Lopez starts for the Sox against Jason Hammel.