LOS ANGELES (AP) — Clayton Kershaw pitched the final regular-season home game of his 18-year career with the Los Angeles Dodgers on Friday, welcomed and sent off with standing ovations a day after announcing his decision to retire at season's end.

Kershaw's longtime warmup song, “We Are Young" by Fun, blared as fans held up camera phones to capture the moment as the game began and he took the field by himself at first. The cheers quickly turned to boos when San Francisco Giants leadoff hitter Heliot Ramos turned on an 86-mph slider for a 431-foot home run.

“I was grinding out there, working way too hard to get people out,” he said.

But the cheers returned after Rafael Devers took a called third strike leading off the fifth. Manager Dave Roberts came to the mound and hugged Kershaw as his teammates on the field, in the dugout and in the bullpen joined the sellout crowd of 53,037 in applauding the 37-year-old left-hander as he departed.

Kershaw kept the ball and got no argument from Roberts.

“I said, ‘You can do whatever you want, it’s your night,'" the manager said.

Kershaw left with the Dodgers trailing 2-1. He gave up two runs and four hits, struck out six and walked four in 4 1/3 innings on 91 pitches, 56 for strikes.

“It wasn’t his best,” Roberts said, “but like he does, he just finds ways to compete, get outs and put us in a position to win a ballgame.”

The defending World Series champion Dodgers rallied for a 6-3 victory to clinch their 13th consecutive postseason berth.

“We got a win, we clinched a playoff berth, I got to sit on that mountain one last time,” he said. “I just can't be more grateful.”

Kershaw waved as he walked off, blew a kiss toward his family and then wrapped his arms around himself in a hugging gesture to the crowd. Two-way superstar Shohei Ohtani stepped forward to hug Kershaw, one of many he received from everyone in the dugout. With fans clamoring, Kershaw came out for a curtain call, slowly turning around and soaking in the scene.

“I wouldn't change it," he said. “Perfect night.”

Fans donned No. 22 jerseys in a salute to Kershaw, although Ohtani’s No. 17 was prominent as usual.

Kershaw was surrounded by teammates, his pregnant wife Ellen, who was in tears, their four children, friends and fans who've watched him work his way through the Dodgers' farm system to reach the majors at age 20 and go on to win three Cy Young Awards as well as two World Series championships and throw a no-hitter in 2014.

“Having things to celebrate is only as good as the people you have to celebrate with,” he said.

Also on hand were former teammate Russell Martin, who caught Kershaw's major league debut in 2008, and Los Angeles Rams quarterback Matthew Stafford, who was Kershaw's high school football teammate in Texas.

“This is one of those moments that people are going to look back and go, ‘I was there for the last time he started a home game at Dodger Stadium,’” Roberts said before the game.

Kershaw, a Dallas native who lives there in the offseason, has spent his entire 18-year career in Los Angeles.

“In a world that people take the easy way out, chase short money, the grass is greener kind of adage, the loyalty part of it is just not what it used to be,” Roberts said. “Clayton lives by those values and it means something for him to wear the same uniform. That’s where I gained a lot of respect for him.”

Among Kershaw's milestone moments in the city was reaching 3,000 career strikeouts in July.

The Dodgers added a Kershaw bobblehead to their promotional schedule in July after he reached the milestone and the item will be given out Saturday. He will address the fans before Sunday's game.

“Everybody who is just a fan is going to wrap their arms around Clayton Kershaw,” teammate Freddie Freeman said. “He deserves everything he’s going to get from the fans.”

While his velocity has dipped in recent years, Kershaw's famed competitive fire still burns brightly.

“Winning is always my favorite thing,” he said.

Kershaw has battled injuries in recent years that made getting to this point all the harder. He missed the entire postseason last year, when the Dodgers beat the New York Yankees in the World Series.

“Not a lot of people get this opportunity,” he said, “so I’m just super grateful for it.”

Kershaw said he would make another start next week in Seattle, where the Dodgers end the regular season.

___

This story has been updated to correct that this will be Kershaw’s last home start in the regular season, not his last regular-season start overall.

___

AP MLB: https://apnews.com/MLB