Joe Panik hit an RBI single with two outs in the 11th inning, and the San Francisco Giants beat the Kansas City Royals 2-1 on Tuesday night to begin their two-game interleague set.

Nick Hundley doubled off Scott Alexander (0-1), the Royals' fifth reliever of the night, before Panik's sharp liner dropped in front of center fielder Lorenzo Cain to score the go-ahead run.

Derek Law (1-0) pitched two scoreless innings of relief for San Francisco, and Mark Melancon struck out Raul Mondesi with runners on first and second in the 11th for his third save of the year.

The Giants, back at Kauffman Stadium for the first time since their 2014 World Series triumph, were without manager Bruce Bochy, who underwent a minor procedure to correct his heart rhythm.

Bochy is expected to return to the team Friday at Colorado.

The Royals had several chances to end the game earlier, leaving the bases loaded in the eighth, two aboard in the ninth and two more on base when Eric Hosmer grounded into a double play in the 10th.

San Francisco also left two runners aboard in the 10th when Buster Posey, fresh off the seven-day concussion list, struck out. Posey already had three hits on the night.

The Giants' Matt Cain and the Royals' Jason Hammel waged a nip-and-tuck duel of starters, each taking advantage of double plays and nifty defense to escape sticky situations.

Cain left two aboard in the first, and also stranded runners in the second and fourth, before he threw a mistake that Whit Merrifield deposited into the right-field seats. Cain walked the next batter, but set down the next seven to leave after seven innings with the game knotted at 1.

Hammel was perfect through four before getting into trouble in the fifth, then allowing Hunter Pence's run-scoring single in the sixth. He got through that inning and allowed the first two batters to reach in the seventh, but relievers Peter Moylan and Travis Wood bailed him out of that fix.

BOCHY RECOVERING: Bochy said in a text message to The Associated Press that he was doing well following the procedure in San Diego. Bochy also underwent a heart procedure in February 2015 and was hospitalized last summer with an undisclosed illness. Bench coach Ron Wotus filled in for him in Kansas City.

POSEY RETURNS: Posey was experiencing concussion-like symptoms after he took a 94 mph fastball off the helmet from Arizona's Taijuan Walker last week. The Giants cleared space on the roster for him by designating backup catcher Tim Federowicz for assignment shortly after batting practice.

TRAINER'S ROOM: Royals OF Jorge Soler (left oblique strain) felt some tightness on Saturday and his rehab work was shut down for a couple days. He resumed swinging before Tuesday night's game.

UP NEXT: Giants LHP Madison Bumgarner makes his first start at the K since Game 7 of the 2014 World Series, where he memorably pitched in relief to help San Francisco close out the series.

Royals LHP Jason Vargas tries to continue his hot start. He is 2-0 with a 0.66 ERA in his first two outings, and tossed 7 2/3 scoreless innings against Oakland his last time out.