Gabe Lacques

USA TODAY Sports

Alex Rodriguez’s 22-year baseball career will come to an end on Friday when he plays his final game for the New York Yankees, and then assumes a special advisor role with the club, the Yankees announced Sunday.

The Yankees and Rodriguez held a news conference Sunday to signal the end of a complex and undeniably dominant career. Rodriguez is still owed $21 million in $2017 and about $7 million for the remainder of this year; the Yankees will release him following Friday’s game and he’ll continue in a role as advisor through 2017. General manager Brian Cashman confirmed that Rodriguez will receive his full salary through the expiration of his 10-year, $275 million contract.

Rodriguez’s final game will come Friday night at Yankee Stadium against the Tampa Bay Rays, the final chance to add on to a resume that includes 696 home runs, fourth in baseball history.

Alex Rodriguez: Final weeks on bench with Yankees 'painful and embarrassing'

“This is a tough day,” Rodriguez said Sunday. “I love this game, and I love this team. And today, I’m saying goodbye to both.”

Said Yankees chairman Hal Steinbrenner in a statement: “After spending several days discussing this plan with Alex, I am pleased that he will remain a part of our organization moving forward and transition into a role in which I know he can flourish,” said Yankees Managing General Partner Hal Steinbrenner. “We have an exciting group of talented young players at every level of our system. Our job as an organization is to utilize every resource possible to allow them to reach their potential, and I expect Alex to directly contribute to their growth and success. Baseball runs through his blood.

“He’s a tireless worker and an astute student of the game. Alex has already proven to be a willing and effective mentor to many players who have come through our clubhouse, and I am confident that this next phase of his baseball life will bring out the best in Alex and the next generation of Yankees.”

Rodriguez and general manager Brian Cashman went to great lengths to frame the decision as a mutual one between ownership and player.

Why retiring A-Rod will still get $27 million from Yankees

“The one thing I’ve gotten from Alex is, he’s at peace, and this was a joint decision between he and Hal Steinbrenner,” Cashman said. “I think Alex truly is at peace and comfortable with the decision he was a part of. That’s the best I can represent from conversations with Alex and Hal.

Sunday’s move will continue the marriage of a player who filled New York’s hallowed ballpark and the pages of its tabloids with equal fervor.

New York was where A-Rod earned some ugly tags: Drug cheat, philandering husband, pariah, serial liar, postseason choke artist.

It’s also where he found redemption: Two MVP awards, a star turn in the 2009 postseason, and an unlikely comeback tale after serving a humbling, yearlong ban in 2014 for his role in the Biogenesis performance-enhancing drug scandal.

“I want to be remembered as someone who tripped and fell a lot, but kept getting up,” Rodriguez said Sunday

At 41, he’s now a man without a team, but his career numbers nearly speak for themselves: 696 home runs, 3,114 hits, a lifetime .930 on base plus slugging percentage. His 118 Wins Above Replacement rank 12th all-time, sandwiched by Ted Williams and Lou Gehrig. Every player above him on that list, with the exception of Barry Bonds, is in the Hall of Fame.

Like Bonds, A-Rod’s Cooperstown candidacy will be affected by his significant dalliances with performance-enhancing drugs.

Unlike Bonds, Rodriguez aimed to get out in front of his public image. In a 2007 60 Minutes interview, Rodriguez vigorously denied using performance-enhancing drugs after winning his second MVP award in leading the major leagues with 54 home runs, 156 RBI and a 1.067 OPS.

Two years later, Sports Illustrated reported that Rodriguez failed a 2003 drug test as part of survey testing that was supposed to remain confidential. Faced with this report, Rodriguez copped to using steroids in the 2001, 2002 and 2003 seasons – when they weren’t specifically banned by baseball – as he began a 10-year, $252 million contract with the Texas Rangers.

The baseball world reacts to Alex Rodriguez's retirement announcement

The Rangers eventually traded him to New York in 2004, where he deferred to Yankee legend Derek Jeter and moved from shortstop to third base. His first five seasons in the Bronx featured more gaudy production – he averaged 42 home runs and posted a .974 OPS in this span – but also no shortage of off-field woes.

His marriage collapsed, not long after photos emerged of him in Toronto with a stripper. His clumsy public-relations skills betrayed him again when he exercised an opt-out clause in that $252 million deal in the midst of the Boston Red Sox’s clinching the 2007 World Series.

Faced with trying to sell a burgeoning sports network minus the team’s biggest potential star, the Yankees capitulated and lavished Rodriguez with a new 10-year deal, worth a record $275 million. George Steinbrenner and sons figured they’d be paying for some decline years, but couldn’t have envisioned the drama ahead.

First, in 2009, came the 2003 steroid bombshell, after which Rodriguez professed his contrition, returned from a hip injury, put up yet another 30-homer, 100-RBI season, and then left behind several years of postseason failures by performing gallantly in the Yankees’ run to the World Series title, their first since 2000.

In 2010, Rodriguez produced his 13th consecutive 30-homer, 100-RBI season - nobody has more – but it would be his last. Injuries limited him to 99 games in 2011 and 122 in 2012, when he produced a career-worst .783 OPS. He followed that with a 3 for 27 (.111) performance in the postseason, getting benched in the AL Championship Series.

Rodriguez would require hip surgery, it turned out, but his woes were just beginning. A January 2013 report in the Miami New Times strongly linked Rodriguez to the Biogenesis anti-aging clinic, whose records seemed to indicate Rodriguez used PEDs in multiple seasons following his 2009 mea culpa.

That set off a 12-month saga pitting Rodriguez against both friend and foe: the Yankees and Major League Baseball and even the players’ union. He appealed an initial 211-game suspension and sank millions of dollars into legal fees, ultimately suing the players’ association.

Finally, after an arbitrator’s ruling in January 2014, Rodriguez accepted a 162-game ban, costing him $25 million in salary.

At 39, and having not seen major league pitching in 18 months, the odds were stacked against Rodriguez’s renaissance in 2015. He responded with a 33-home run season, recorded his 3,000th hit with a home run off Justin Verlander and earned some level of reverence among teammates and fans.

The aging curve bit him hard this season, however, as his OPS dropped from .842 to .609 and his playing time – already limited by his DH-only status – diminished. Last week, Rodriguez sat against Mets starter Bartolo Colon, a pitcher he’d lit up for a .425 average and eight home runs over their 19 years in the major leagues.

Friday, first baseman Mark Teixeira, 36, announced his retirement at the end of the season, when his eight-year, $180 million contract expires.

This week, Rodriguez will join him.

GALLERY: A-ROD THROUGH THE YEARS