BOSTON -- The sun was still about three hours from rising when Red Sox general manager Ben Cherington agreed in principle on the first of four trades he would make in one of the most eventful transaction days in team history.
With most New Englanders snug in their beds on Thursday morning, Cherington closed the deal for the slugger he coveted, Athletics outfielder Yoenis Cespedes, who is in his prime and has a season remaining on his contract.
To get him, the Red Sox had to part with long-time ace lefty Jon Lester, who will be a free agent at season's end. Jonny Gomes, who played for Oakland in 2012 and hit a huge home run for Boston in Game 4 of last year's World Series, went with Lester in the deal.
"We had an agreement in principle on the structure -- it was probably between 3-4 this morning," said Cherington. "And then, you know, you've got to get through medicals and Major League approval and all of that stuff, so it doesn't get really official until later."
As it turned out, Cherington was just getting started with that blockbuster swap of two players who were teammates earlier this month at the All-Star Game.
Veteran No. 2 starter John Lackey went to the Cardinals for Allen Craig and Joe Kelly. Top lefty setup man Andrew Miller was dealt to the Orioles for left-handed pitching prospect Eduardo Rodriguez. Stephen Drew moved to the Yankees for infielder Kelly Johnson.
For all the talk that Lester would be traded for a prospect, Cherington was determined to bring in someone who could put the baseball into the seats, and that's what he got in Cespedes, who will keep his No. 52 in Boston and could debut Friday at Fenway against the Yankees.
All season long, the Red Sox have lacked a significant offensive presence behind David Ortiz. Though the arrival of Cespedes is probably too late to salvage Boston's postseason hopes this season, he gives them a cornerstone for 2015 and perhaps beyond.
"We think he'll thrive," said Cherington. "He's someone who obviously seems comfortable on the stage, obviously given his performance in different events and what not and postseason and he's a really powerful, dynamic player in his prime who fits in our ballpark and the outfield."
As part of the deal, the Red Sox sent cash to the A's -- less than $1 million, according to a source. The Red Sox also get the second pick in the Competitive Balance Round B of next year's Draft.
"There were lots of different things we could have done and there were attractive prospect packages that were available to us for both guys," Cherington said of Lester and Lackey. "You know, we just felt like what made the most sense for us was to try to focus on impact Major League talent that's ready and we have a lot of good young players. We have strength in our farm system. So that's already a strength.
"We wanted to add to the Major League team and really give ourselves a head start on building again and becoming as good as we can as quickly as possible."
The way Cherington explained it, as of July 21, the night the Sox blistered the Blue Jays, 14-1, he still planned on being a buyer at the Deadline instead of a seller. At that point, his team had won eight out of nine and was showing some life for the first time in weeks.
But then came another free-fall, in which Boston lost eight out of nine, and Cherington knew what he had to do. At the time of the trade, the Sox were 48-60, which put them last place in the American league East and 13 games behind the first-place Orioles.
Starting with the Jake Peavy trade to the Giants on Saturday, Cherington subtracted seven members of last year's World Series-winning team in less than a week.
"I knew that the more the math built against us, the more possibility there was to be able to have to face some of this and these tough decisions with people that have meant a lot to the Red Sox and who I've known for a long time and have done great things for the organization," said Cherington.
Cespedes, who is mainly a left fielder but has also started three games in center this season, could transition to right field as early as Friday. Once again, Shane Victorino is injured, and Cherington said the club would like to see how comfortable Cespedes is in right.
The 28-year-old signed a four-year, $36 million contact with the Athletics. Per terms of the deal, he can become a free agent if he isn't re-signed by Oct. 31, 2015, or five days after the last game Boston plays that season. In addition, the Red Sox are unable to make a qualifying offer to Cespedes, which means they would not receive Draft-pick compensation if he were to sign elsewhere as a free agent.
Though the Red Sox have long valued Lester as a pitcher, a teammate and a leader, his contract is due to expire at the end of this season and the club feared losing him for nothing more than Draft-pick compensation.
A few days ago, Lester told reporters he would still be open to re-signing with the Red Sox even if he got traded. So there's at least a chance Boston could have a 2015 roster that features Lester as the ace and Cespedes as a key hitter.
"What happens [down the road], that's not for me to talk about," said Cherington. "Right now, he's an Oakland A. He's got a job to do for them. When we get to the offseason, we get to the offseason."
Cespedes has won the Home Run Derby each of the past two years. In 101 games this season, Cespedes is hitting .256 with 17 homers and 67 RBIs.
This trade at least temporarily ends the long association between Lester and the Red Sox. He was drafted by Boston out of Bellarmine Prep in Tacoma, Wash., with the 57th overall pick in 2002, and by June 2006, he was at Fenway Park making his Major League debut.
Aside from a shaky 2012 season, Lester was a model of consistency with the Red Sox, compiling a 110-63 record and a 3.64 ERA while making the All-Star team three times, including this season.
Ian Browne is a reporter for MLB.com. Read his blog, Brownie Points, and follow him on Twitter @IanMBrowne.