Ryan O'Hearn led off the 10th inning with his second homer of the game, sending the Kansas City Royals to a wild 9-8 win Sunday over the Indians, whose playoff chances were severely rocked by losing Ramírez to a broken right hand.

CLEVELAND (AP) — José Ramírez swung and felt something crack.

It was a bone in his right hand. It may as well have been Cleveland's postseason hopes.

Ryan O'Hearn led off the 10th inning with his second homer of the game, sending the Kansas City Royals to a wild 9-8 win Sunday over the Indians, whose playoff chances were severely rocked by losing Ramírez to a broken right hand.

Down 8-4, the Indians fought back and tied it in the ninth against Ian Kennedy (1-2) on Francisco Lindor's solo homer and Franmil Reyes' stunning three-run shot with two outs.

But Nick Goody (3-1) got too much of the plate with a four-seam fastball and O'Hearn drove it over the right field wall as the Royals salvaged a back-and-forth series finale to snap a four-game losing streak.

Losing the game was secondary to the Indians, who will be without Ramírez as they try to catch Minnesota in the AL Central or win a wild card. The two-time All-Star will undergo surgery Monday in New York to repair a hamate bone he fractured Saturday night.

The Indians, who have dealt with major injuries all season, won't know how long Ramírez will be out until after the procedure. But they know he won't be at third base or batting fifth for the next few weeks — and perhaps the remainder of the season.

"We've got to deal with it," said starter Shane Bieber, who settled in after a few rough innings. "It's a big blow. We're not really faced with a choice, it's just next man up."

Jorge López worked the 10th for his first major league save.

Ramírez, who awakened from a puzzling, early-season offensive slump in time to propel the Indians back into postseason contention, feared the worst when he was forced to leave Saturday's game in the first inning.

"You still try to stay optimistic and see if they can tell you better news," he said through a translator. "But I knew something was bad when it happened."

Trailing by four and down to their final strike, the Indians tied it against Kennedy.

Lindor homered with one out before Kennedy walked Carlos Santana with two outs and gave up a single to Yasiel Puig.

Kennedy's wild pitch moved the runners up and Reyes, whose homer leading off the eighth pulled Cleveland to 8-4, brought them home with a 423-foot shot to left, rewarding Indians fans who hung around after the team fell behind 8-3.

"It was crazy," Reyes said. "Honestly, it was one of the best moments in my life, not my career. It was great."

Kansas City's five-run eighth was triggered by shortstop Lindor's error and highlighted by Jorge Soler's two-run homer — a 437-foot drive.

Kevin Plawecki hit a two-run homer for Cleveland, which dropped 3½ games behind the first-place Twins. The Indians still hold a wild-card spot in a tight race with Tampa Bay and Oakland for the two AL berths.

TURNAROUND

O'Hearn said the Royals didn't hang their heads after Cleveland's four-run ninth.

"As soon as the inning was over, I was the first guy up," he said. "I went in there, got my stuff and got ready to hit. It can be tough. It's part of the game. Nobody as far as I know was down."

BIG BLAST

Soler's homer moved him into a tie with Steve Balboni for the second-most in a season in franchise history. Balboni hit 36 in 1985. Mike Moustakas set the club record with 38 in 2017.

FRESH START

Royals left-hander Eric Skoglund was sharp in his season debut, allowing only two hits in five innings. The left-hander was suspended for the first 80 games for violating Major League Baseball's drug prevention and treatment program.

TRAINER'S ROOM

Royals: SS Adalberto Mondesi (dislocated left shoulder) has played six games on a minor league rehab assignment, but no timetable has been set for his return. He was injured diving for a foul ball on July 16.

UP NEXT

Royals: Open a 10-game homestand, their longest of the season, with RHP Brad Keller (7-13, 3.95 ERA) on the mound against Oakland.