Alex Gordon and Billy Butler both went deep in Kansas City’s four-run third inning Wednesday night, the Royals survived a harrowing ninth and held on for a 5-4 victory over the AL East leading New York Yankees.

Butler’s ball appeared to strike the upper railing behind left field before bouncing back onto the field. Umpires ruled it a home run but went in to look at a review after talking to New York manager Joe Girardi.

Replays showed the ball hitting the padding below the railing and bouncing up toward the front row of fans before coming back onto the field.

The Yankees loaded the bases with one out in the ninth and made it 5-4 on Robinson Cano’s sacrifice fly. After a passed ball, Joakim Soria reloaded the bases by walking Nick Swisher. Then Jorge Posada, on his 40th birthday, took a called third strike to end it. The wobbly Soria got his 22nd save in 29 opportunities.Bruce Chen (8-5) went six innings and beat the Yankees for just the second time in seven career decisions.