In the Braves’ first visit to Kauffman Stadium, Jason Heyward turned in a memorable performance for a sizable contingent of Braves fans who showed up for the event. Then Craig Kimbrel brought their hearts into their throats.

Heyward put the Braves ahead with a two-run double in the fifth inning, and put them ahead again with a seventh-inning homer that sent Atlanta to a 4-3 win Tuesday night against the Kansas City Royals. But not before there was much consternation in the ninth, when Kimbrel wiggled out of a two-on, no-outs jam for his 21st save.

“Those are not the way you draw it up, but we’ll take it,” said manager Fredi Gonzalez, whose Braves took the opener of a two-game series and got their second consecutive win since losing three in a row and five of six.

Kimbrel walked the leadoff hitter in the ninth and gave up a single by David Lough to put Royals on the corners with none out in a one-run game. Then the formidable closer went to work, striking out Elliott Johnson and Jarrod Dyson, the latter after a stolen base put two runners in scoring position.

“I’d much rather it be 1-2-3,” Kimbrel said. “Whenever you walk the leadoff hitter in a one-run ballgame, it’s kind of a sticky situation.”

After falling behind 2-0 and electing to intentionally walk Alex Gordon to load the bases, he coaxed a game-ending fly ball by Alcides Escobar. Kimbrel’s expression conveyed more of an adrenaline rush than after a typical save.

“Of course,” he said. “I was that close to giving up the game, and then a few batters later we won the game. Any time that happens, I definitely get excited. Not for myself, but for the team.”

Heyward’s first three-RBI game this season helped Kris Medlen (5-7) improve to 4-1 with a 2.14 ERA in five June starts. Heyward was hit by a pitch in the back of his right elbow in the ninth and treated at first base, but stayed in and made the catch for the final out. He had some swelling afterward and wasn’t sure if he’d play Wednesday.

After the Braves got three runs on four consecutive hits to start the fifth inning, Medlen coughed up a 3-1 lead in the bottom of the inning on Eric Hosmer’s two-run, two-out homer.

But he recorded seven outs in the next seven batters, including a double-play grounder to end the sixth before he struck out all three batters in the seventh, after Heyward’s homer in the top of the inning gave the Braves another lead.

“You can’t give up two leads,” said Medlen, who allowed three runs, seven hits and one walk with five strikeouts in seven innings. “And for J-Hey to come up and hit that (home run) – I knew I had to have a nail-down inning.”