SAN FRANCISCO (AP) — The first-place San Francisco Giants made a big splash just before the trade deadline Friday, acquiring star slugger Kris Bryant from the Chicago Cubs for two minor leaguers.

San Francisco sought an experienced third baseman given the club has been without Evan Longoria because of a sprained shoulder since June 5, when he got hurt in a collision with shortstop Brandon Crawford. Longoria is on the 60-day injured list.

Chicago received right-hander Caleb Kilian and outfielder Alexander Canario in the deal.

The 29-year-old Bryant, who can become a free agent after this season, was one of the top position players available on the market as the disappointing Cubs sold off several stars. He is batting .267 with 18 home runs and 51 RBIs.

The versatile Bryant, a four-time All-Star, was the 2015 NL Rookie of the Year and 2016 NL MVP, when he helped the Cubs win the World Series to end a 108-year championship drought.

The surprising Giants began the day with a three-game lead in the NL West over their biggest rivals, the defending World Series champion Los Angeles Dodgers.