The Braves have the the worst record in the majors, but try telling vaunted Royals closer Wade Davis that Atlanta is a pushover.

The Braves scored two runs off Davis in the ninth inning to erase a 2-0 deficit and force an extra-inning marathon, with the Royals pulling out a 4-2 victory when off Jason Grilli gave up a two-run walk-off homer to Kendrys Morales, the first batter he faced.

Grilli was the sixth Atlanta reliever after starter Matt Wisler pitched into the eighth inning of another impressive start. Morales homered to straightaway center on a 3-2 sinker that caught too much of the plate, on a nine-pitch at-bat.

“It was a big hit, but I’m proud of the club,” said manager Fredi Gonzalez, whose Braves’ majors-worst 9-27 record includes a 2-6 in a majors-high eight extra-innings games. “We battled. Wisler pitched great, the bullpen did a terrific job…. I thought we did a lot of good stuff, and it’s a shame we lose the game.”

Asked if the Braves could take some positives from a series in which they shut out the Royals 5-0 on Saturday and rallied against the game’s top closer Sunday, rookie center fielder Mallex Smith said, “We’ve got to find a way to get him a win.”

Mallex Smith pleased to be in lineup on special day

Alcides Escobar led off Kansas City’s 13th with a single against left-hander Eric O’Flaherty, who struck out Alex Gordon and got Eric Hosmer on a ground-out to before Grilli entered with a runner at second.

Morales hit his third career walk-off homer and the defending World Series champions improved to 14-6 in extra-inning games since the beginning of 2015, including postseason.

Before Sunday, the switch-hitting Morales had a .364 average and .545 slugging percentage in 33 at-bats against left-handers and a .150 average and .260 slugging percentage in 100 at-bats against right-handers. He was also 4-for-5 with a homer off O’Flaherty, so the Braves didn’t hesitate bringing in Grilli to face him.

“Morales hit that ball pretty hard,” said Braves infielder Chase d’Arnaud, who had two hits and drew a walk and scored in the two-run ninth. “It seems like we’ve been trying to avoid facing him from the right side this whole series, so once again we had him from the left side and he just happened to connect that time.”

The Braves won six of their past 10 road games before dropping two of three to the Royals. Their 10-game, three-city trip continues Monday with the opener of a four-game series at Pittsburgh.

Braves reliever Bud Norris pitched two solid innings and Ian Krol got out of a runners-on-the-corners, two-out jam in the 10th by inducing a comebacker from Eric Hosmer, scrambling to retrieve the ball after it caromed off his glove and tossing to first base for an inning-ending close play. Arodys Vizcaino also pitched two perfect relief innings.

Davis had a majors-best .083 opponents’ average before Sunday, when the Braves got three hits against him before he recorded his second out in the ninth inning, matching the total hits Davis had given up all season.

“It’s nice feeling that momentum shift in our direction in the ninth,” d’Arnaud said. “Everybody was battling. I feel like we always have a chance, especially today.”

Ender Inciarte led off the ninth with a single and d’Arnaud walked before Smith drove in a run with a single down the right-field line, with Smith caught in a rundown for the first out.

Erick Aybar followed with a pinch-hit bloop single that brought in the tying run, and a crowd of 33,861 seemed stunned.

Davis had converted a majors-best 25 of 26 save opportunities since the beginning of the 2015 season and posted a franchise-record 0.94 ERA in 2015. He retired 24 of the past 28 batters he faced before Sunday, when he gave up three hits and a walk to the first four Braves in the ninth.

The Braves forced extra innings and got Wisler off the hook on a day when the young right-hander again pitched like a budding ace, allowing eight hits and two runs in 7 1/3 innings, with no walks and seven strikeouts.

The Braves, trailing 1-0 after the first inning, had scoring opportunities in the fifth, sixth and seventh. They got consecutive two-out singles in the sixth from Tyler Flowers and Jeff Francoeur, but the Braves were left frustrated when Inciarte was called for a third strike that looked at least six inches outside.

After d’Arnaud’s leadoff double in the seventh, Smith tried to bunt with none out and popped out foul with the count 2-1. He made the decision on his own, Gonzalez said, and was told later by a staff member that it was a mistake to bunt in that situation. When the same situation came up in the ninth, his hit drove in the Braves’ first run.

After Smith’s failed bunt in the seventh, d’Arnaud was thrown out trying to advance to third on a grounder in front of him.

With former Braves pitcher Kris Medlen (shoulder inflammation) scratched from a scheduled start for the Royals after landing on the 15-day disabled list Thursday, left-hander Danny Duffy moved from the bullpen for his first start of the season and allowed one hit and two walks in three innings.

Eight other relievers followed including former Brave Peter Moylan in his Royals debut.