SAN DIEGO — Let the restocking begin.

After falling short in the Jon Lester sweepstakes, the Boston Red Sox have traded outfielder Yoenis Cespedes to the Detroit Tigers for pitcher Rick Porcello, and several media reports also say Boston has agreed to a one-year deal with free-agent pitcher Justin Masterson.

Pitchers Alex Wilson and Gabe Speier also went to Detroit as part of the trade, which the Tigers announced Thursday.

The Red Sox were in the market for pitching after Lester signed with the Chicago Cubs earlier this week. Boston traded with Arizona for lefty Wade Miley on Wednesday, and the Porcello came out Thursday. Porcello made his debut with Detroit in 2009 as a 20-year-old, and he’s been a mainstay in the Tigers’ rotation ever since. He is coming off a season in which he set career bests with 15 wins, a 3.43 ERA and 204 2/3 innings pitched.

Masterson, 28, is coming off a disappointing 2014 where he went went 7-9 with a 5.88 ERA in 28 appearances between Cleveland and St. Louis.

The Red Sox acquired Cespedes in July in the deal that sent Lester to Oakland. Cespedes finished the year with a .260 average, 22 home runs and 100 RBI. The 29-year-old Cespedes gives Detroit another power-hitting presence in the middle of its lineup, along with Miguel Cabrera and Victor Martinez, but the Cuban slugger came at a significant price.

Cespedes and Porcello could both be free agents after this season. Cespedes will make $10.5 million in 2015. Porcello is arbitration eligible after making $8.5 million this year.

Detroit already made one addition to its outfield this offseason, acquiring speedy center fielder Anthony Gose from Toronto. Cespedes joins a group of outfielders that also includes J.D. Martinez and Rajai Davis. If J.D. Martinez can repeat his 23-homer performance of 2014, the Tigers should have plenty of power threats.