The Tampa Bay Rays acquired outfielder David Peralta from the Arizona Diamondbacks, adding a veteran left-handed bat for the playoff race.

The Rays sent 19-year-old minor league catcher Christian Cerda to the Diamondbacks.

The 34-year-old Peralta has played his entire nine-year major league career with the D-backs, with whom he won a Silver Slugger award in 2018 and a Gold Glove in 2019.

Peralta — a fan favorite in Arizona — has a .248 average, 12 homers and 41 RBIs this season.

RED SOX’S STORY has hairline fracture >> A second-opinion exam on second baseman Trevor Story’s bruised right hand revealed a little hairline fracture and he’ll be shut down from swinging a bat for 10 days.

Story, who signed with the Red Sox as a free agent during the offseason, has been on the injured list since July 14 after getting hit on the hand by Tampa Bay’s Corey Kluber.

ROCKIES’ BARD SIGNS EXTENSION >> Colorado Rockies closer Daniel Bard has signed a two-year contract extension.

Bard, 37, was the subject of trade rumors ahead of Tuesday’s deadline but his deal keeps him with Colorado through 2024.

The hard-throwing righty is 3-3 with 21 saves and a 1.91 ERA in 37 games this season.

Bard broke into the majors with Boston in 2009 and spent five seasons with the Red Sox.

He briefly retired from baseball and served as a player mentor for the Arizona Diamondbacks in 2018-19, then signed with the Rockies in 2020.

He earned NL Comeback Player of the Year honors in the pandemic-shortened 2020 season, going 4-2 with six saves and a 3.65 ERA in 23 games. He regressed in 2021 with a 7-8 record, 20 saves and a 5.21 ERA but has bounced back this season.

In three seasons with the Rockies, Bard is 14-13 with a 3.94 ERA and 47 saves.