When the Baltimore Orioles extended what was reported to be a five-year, $90 million offer to Yoenis Cespedes last week, Chris Davis appeared to be all but gone. Just a few days later, the slugging first baseman agreed to the largest contract in franchise history.

The Orioles and Davis agreed to a seven-year, $161 million pact over the weekend.

Davis will receive $17 million annually from 2016 to 2022 -- a total of $119 million -- and additional payments each year through 2037, a source told Buster Olney of ESPN. There will be no interest accrued on the deferrals, which will run through Davis' 51st birthday.

Ken Rosenthal of FOX Sports reports there is no opt-out in the agreement. The contract dwarfs the $85.5 million deal the Orioles gave to Adam Jones nearly four years ago, which had been the biggest ever issued.

Davis, who turns 30 in March, has led the Major Leagues in home runs in two of the last three seasons. He has 126 home runs over that span. He finished third in the American League MVP voting in 2013 and fourteenth this past season. Detractors point out his high strikeout rate (31%, 208 Ks in 2015), but Davis has been tremendously valuable to Baltimore, leading them in nearly every offensive category.

When right -- Davis had a down 2014 season (.196/.300/.404 with 26 home runs) -- he has been one of the top positional players in the AL despite average, and sometimes, below average defense. He posted a combined 11.7 WAR over the 2013 and 2015 seasons, a total surpassed by only Mike Trout, Josh Donaldson and Miguel Cabrera.

As with any long-term contract, the key for the Orioles will be how long Davis can maintain his elite production. He doesn't rely on speed, so there is a good chance he'll keep hitting the ball out of the park into his mid-30s, but there are always concerns about abilities like hand-eye coordination and hand/wrist speed, even if they usually diminish slower than other physical tools.

Ideally, Buck Showalter will get a handful of .260/.350/.550 seasons from Davis with 40-plus home runs and more than 120 runs batted in. If he can maintain that level of production over the first four seasons of his new deal, you can consider this a $161 million win for Peter Angelos.

There was a game of chess played at a snail's pace behind-the-scenes with Angelos wanting Davis re-signed all along, Showalter and Dan Duquette waiting (sometimes impatiently) for Davis to make a decision and Scott Boras playing his usual game of poker in hopes of landing the largest possible deal.

Baltimore offered Davis a seven-year, $150 million deal in early December before reports indicated they pulled it back without increasing the overall value. Speaking at a conference this week, the typically blunt Showalter expressed frustration with Davis for what was perceived as either greed or indecisiveness.

"How much is enough?" Showalter told the Baltimore Sun. "I asked Chris during the season, 'Chris, when you walk into a Target store, can you buy anything you want? So, how much is enough?'

"I love Chris, but if that [his decision] makes or breaks our team, shame on us."

It seems that Baltimore's offer to Cespedes played a role in ultimately re-signing Davis, if for no other reason than timing. The two sides couldn't come to an agreement despite weeks and weeks of negotiations, then a potential power replacement appears and suddenly those talks got much more serious.

In the grand scheme, Davis and Boras still come out the winners. If the Orioles tried to goose Davis with the Cespedes offer, which seems to still be much lower than he's seeking, the tactic only got Boras back to the table. Once there, Davis got the Orioles to increase their initial offer by 7.3% perfect, even if $42 million of the money is deferred over a 15-year stretch that begins when this contract expires. It actually provides him more financial stability post-baseball.

Grade for Davis: A

The Orioles are in a place they have never been before. They are projected to have a payroll close to $140 million with holes still to fill. The most prominent needs include a starter pitcher and right fielder, which could push the payroll close to $155 million. Last year's $118 million payroll was a franchise mark.

There is a chance they won't sign an additional outfielder if they feel comfortable with an odd timeshare at first, in right and designated hitter with Davis, Mark Trumbo and perhaps Nolan Reimold.  

Grade for Orioles: B

Some have given the Orioles a failing grade for handing Davis the keys to a Brink's truck, but when you consider the alternative it's not a terrible deal. Losing him may have been a death sentence for the current core of Adam Jones, Matt Wieters and J.J. Hardy. Cespedes is incredibly streaky and would have been an unknown in clubhouse that embraces Davis. Looking make an overpay for a power hitter? The devil you know is better than the devil you don't.