Jon Lester is leaving Boston. (Jim Rogash / Getty Images)

The Oakland A’s, with the best record in baseball, made a bold move to add starting pitching, sending Yoenis Cespedes to Boston for Jon Lester, the most acclaimed left-hander in Red Sox history.

The move, hours before the non-waiver trade deadline, is a classic one for the A’s, although the blockbuster was a bit of a curveball from Billy Beane’s Moneyball approach. It improves the A’s rotation, with Lester a World Series hero for the Red Sox last fall, and fortifies Oakland in the American League, where several teams reportedly were interested in him. But with it comes the departure of the team’s cleanup hitter, the two-time Home Run Derby champion who is hitting .256 with 17 homers and 56 RBI in 101 games.

Lester, 30, is 10-7 with a 2.52 earned run average in 21 starts. He is sixth in the AL with 149 strikeouts, and his ERA is fifth. The Red Sox are also shipping Jonny Gomes to Oakland with money and a future draft pick. Less than a month ago, the A’s made another move for pitching, getting Jeff Samardzija and Jason Hammel from the Chicago Cubs for two of their top prospects. Although Hammel has been ineffective so far, the A’s have a strong rotation, one that might help them get past the AL Division Series Game 5s in which they’ve stumbled the last two seasons.

Not long after making the Lester deal, the A’s sent left-hander Tommy Milone to the Minnesota Twins for outfielder Sam Fuld.

Over parts of nine seasons in Boston, Lester compiled a 110-63 record and is ninth in team history in wins, fourth in starts, and fourth in strikeouts with 1,386. There was some division within the Red Sox over trading Lester, the Boston Globe reported, with several players expressing amazement when it became clear on Tuesday that he was going to be traded because he was scratched from his Wednesday start.

Although Lester wanted to stay in Boston, Red Sox management failed to sign him in the spring and over the early summer, and this trade, for now, is a short-term rental for the A’s. Despite his performance this summer, the Red Sox, last in the American League East, weren’t going to give him a six-year deal.

“Of course you want to keep Lester around and continue playing together. He’s one of the best pitchers in the game. No question about it,” David Ortiz said (via the Globe). “I don’t know, man. It’s frustrating to see him going somewhere else. It’s just the situation that we’re facing right now.”

Cespedes’s situation is a little less clear because he can become a free agent after next season and because of some disappointment in his baserunning in Oakland. The clean-up hitter in a formidable offense, he may find happiness as a power hitter working in Fenway Park.

Cespedes was a fan favorite in Oakland, and this weekend they’ll get something to remember him by.

What’s a little embarrassment when there’s the chance to go for broke?