SAN FRANCISCO -- Evan Longoria expects to win immediately with the Giants, whose run of success in even years is well-documented -- and the club's new third baseman knows all about that.

The Giants' brass realizes that adding Longoria to the lineup and an already-talented infield gives San Francisco a far better chance of bouncing back from a surprising last-place season in the National League West.

The Giants had sought a productive third baseman this winter and got one in Longoria, who was traded from the Tampa Bay Rays on Wednesday for outfielder Denard Span, star infield prospect Christian Arroyo and two minor league pitchers.

"I'm looking forward to bringing everything I can and more to the clubhouse and the organization and being back in the postseason and winning like I expect to do," Longoria said. "It's an even year coming up, and I know the Giants win in even years. That I am looking forward to."

The third-base position had been a priority for San Francisco, and Longoria's durability means a lot too. He has played at least 156 games in each of the past five years, and all 162 in 2014, and he also hit 20 or more homers in each of those five seasons.

"He's sorely needed and will be a great addition for us," Giants general manager Bobby Evans said.

It marked the first big offseason move by each organization.

Tampa Bay in effect is responsible for $14.5 million of the $88 million Longoria is owed, and the Rays took on $13 million in guaranteed money due to Span.

Longoria had $86 million in remaining guaranteed salary and buyout as part of a contract that runs through 2022 and contains a 2023 club option. The $9.5 million in deferred money included in that total was converted to an assignment bonus payable by the Rays from 2025 to 2029. Tampa Bay will give the Giants $2 million by Dec. 31 to cover Longoria's assignment bonus and an additional $3 million by Oct. 31, 2022.

The 32-year-old infielder leaves Tampa Bay as the longest-tenured player in franchise history, after spending all 10 of his big league seasons in a Rays uniform. He is the club's leader with 1,435 games, 261 home runs and 892 RBIs. Longoria started all 30 of the Rays' postseason games at third base.

The Rays thanked Longoria in a tweet on Wednesday.

The 2008 American League Rookie of the Year and three-time Gold Glover batted .261 with 20 homers and 86 RBIs in 2017.

Longoria grew up in Southern California as an Angels fan, but he has plenty of friends who cheer for the rival Los Angeles Dodgers. "I'm going to be saying a lot of sorries," he said.

Also, he will no longer be playing on artificial turf, noting, "I'm excited to be playing on grass."

In November 2012, Longoria received a $136.6 million, 10-year contract with Tampa Bay that added six guaranteed seasons and $100 million to his previous deal. If exercised, the option would make the agreement worth $144.6 million over 11 years. He will complete his 10th season of major league service on the second day of next season, which would have given him the right to approve any trade from the Rays as a 10-year veteran who spent five or more years with his current team.

Rays general manager Erik Neander said trading Longoria "was in the best long-term interest of our franchise."

Still, he was the face of a small-market franchise and meant so much to the city.

"The decision itself was one that was incredibly difficult for us to make," Neander said.

Former teammate Chris Archer reacted to Longoria leaving.

Never thought there would be a day where you weren't a Ray. We will do everything we can to continue the legacy that you created. I'll never forget the things I learned from you.

It was such a pleasure to stand along side you on the diamond. You'll be missed, everyday. pic.twitter.com/xGntiRLKBY — Chris Archer (@ChrisArcher22) December 20, 2017

The 33-year-old Span has hit .283 with 60 homers and 432 RBIs over 10 years in the majors, but San Francisco was looking for more athleticism and steady defense in the outfield. In fact, Giants manager Bruce Bochy had approached Span about the possibility of playing left field going forward. Span led the Giants last season with 73 runs scored, despite a stint on the 10-day disabled list. He previously played for the Washington Nationals and Minnesota Twins.

Bochy expects Longoria to bat third or cleanup, and he already can envision Longoria as part of a top infield with Gold Glove shortstop Brandon Crawford, second baseman Joe Panik and Brandon Belt at first.

"When you talk about the elite third basemen of the game, Evan's name is going to be there. He's been one of the most consistent third basemen in the game," Bochy said. "It's going to be one of the best infield defenses in the game."

Arroyo, a first-round draft pick in 2013 out of high school, was one of the Giants' top prospects but didn't play in the majors after June 2, because of a broken left hand. He batted .192 with three homers and 14 RBIs in 34 games. The Rays have been watching him for years and believe he is making significant strides at the plate.

"That's the cost of doing business," Giants executive vice president of baseball operations Brian Sabean said of sending Arroyo in the deal.

Arroyo is from Brooksville, Florida, which is about an hour north of Tampa. In a tweet, Arroyo said Wednesday he is "bittersweet" about the trade but also "very excited for the opportunity to continue my playing career with the team I grew up watching and cheering for, the Tampa Bay Rays."

The Giants also sent right-hander Stephen Woods and left-hander Matt Krook to the Rays, who acquired third baseman Matt Duffy from the Giants at the 2016 trade deadline for Matt Moore. The left-handed Moore was dealt last week to the Texas Rangers.

As part of the assignment bonus, Tampa Bay owes Longoria $1.5 million on Dec. 15, 2025, and $2 million on Dec. 15 in each of the following four years. San Francisco will pay Longoria salaries of $12 million next year, $12.5 million in 2019, $13 million in 2020, $16.5 million in 2021 and $17.5 million in 2022.

Span gets $9 million plus possible performance bonuses next year, and the Rays inherit a $12 million mutual option for 2019 with a $4 million buyout.

Longoria counts as $11,165,300 annually for the Giants' luxury tax payroll and Span $13,333,333 for the Rays' tax payroll. In addition, the Giants receive a $600,000 yearly credit for the cash transaction in the swap.

San Francisco, which won World Series titles in 2010, 2012 and 2014, made its first big offseason move after missing out on Giancarlo Stanton and Japanese star Shohei Ohtani. The Giants went 64-98 this past season to avoid the club's first 100-loss campaign since 1985.

"This is a long-awaited day in our offseason dealings. The organization just got better," Sabean said. "Hopefully, the fan base and our organization realizes this affirms our commitment to turn our fortunes around as soon as possible, and specifically in the 2018 season. We check off a huge box with this acquisition. Evan is a known player, and quite frankly, you look at his baseball card, we're getting somebody who's not only been an accomplished third baseman of note, but hits in the middle of the order and improves our defense overnight."

Information from The Associated Press was used in this report.