FILE - In this March 12, 2013, file photo, Japan's Masahiro Tanaka pitches against the Netherlands in the fifth inning of a World Baseball Classic second round game at Tokyo Dome in Tokyo. The New York Yankees and Tanaka agreed on Wednesday, Jan. 22, 2014, to a $155 million, seven-year contract. In addition to the deal with the pitcher, the Yankees must pay a $20 million fee to the Japanese team of the 25-year-old right-hander, the Rakuten Golden Eagles. (AP Photo/Toru Takahashi, File)

NEW YORK (AP) -- The Yankees talked frugality, then reverted to their high-spending ways.

New York capped an offseason spending spree by agreeing Wednesday to a $155 million, seven-year contract with prized Japanese pitcher Masahiro Tanaka.

Following just the second season in 19 years that didn't include a playoff appearance, the Yankees flexed their economic might and committed $438 million to four free agents.

Tanaka joined catcher Brian McCann and outfielders Jacoby Ellsbury and Carlos Beltran on a revamped roster missing long-time All-Stars Mariano Rivera, Andy Pettitte and Robinson Cano.

And in addition to the deal with the 25-year-old right-hander, the Yankees must pay a $20 million posting fee to Tanaka's Japanese club, the Rakuten Golden Eagles.

''Anybody that questioned our commitment to winning is going to have to question themselves,'' Yankees co-chairman Hank Steinbrenner said during a telephone interview with The Associated Press.

Big league teams had until Friday to reach an agreement with Tanaka, who was 24-0 with a 1.27 ERA last year as the Golden Eagles won the Japan Series title. Arizona, the Chicago Cubs and White Sox, the Los Angeles Dodgers and Houston all said they were among the failed bidders.

Still, the Yankees have ample uncertainty - especially in an AL East where they compete with World Series champion Boston. And especially with a veteran team that saw 21 players go on the disabled list last year.

David Robertson appears set to inherit the closer's role from the retired Rivera, and New York must try to make up the offense lost when Cano left for a $240 million, 10-year deal with Seattle. Alex Rodriguez is suspended for the entire season and 39-year-old shortstop Derek Jeter has played just 17 games since October 2012.

''I think the entire infield is certainly something that people will focus on,'' New York general manager Brian Cashman said. ''What's Brian Roberts going to be? What's Derek Jeter going to be as he comes back from his injury? What's Mark Teixeira going to be at first base as he comes back from his wrist? Can Kelly Johnson secure and handle on a consistent basis third base?''

New York went 85-77 last year, its worst record since 1992. Attendance and television ratings dropped.

The pinstriped response was similar to the Yankees' behavior after they missed the playoffs in 2008. They spent $423.5 million on CC Sabathia, A.J. Burnett and Teixeira, then won their 27th World Series title.

This offseason included big deals for McCann ($85 million for five years), Ellsbury ($153 million for seven) and Beltran ($45 million for three). Combined with agreements to re-sign Hiroki Kuroda and Brendan Ryan, and to add Roberts, Johnson and Matt Thornton, the Yankees' offseason spending on free agents totals $471 million. Add the posting fee, and the cost was nearly a half-billion dollars.

''There has been criticism of myself and my brother the last couple years that, gee, if our dad was still in charge, we'd be spending this and spending that and doing whatever it takes to win,'' Hank Steinbrenner said, referring to late Yankees owner George Steinbrenner.

''He didn't have revenue sharing, at least for most of his time,'' Hank Steinbrenner added. ''That's what these people in the sports media don't seem to get. If it wasn't for revenue sharing, we'd have a payroll of $300 million a year if we wanted to. So we're doing this despite having to pay all that revenue sharing.''

Tanaka replaces the retired Pettitte in the rotation and joins Sabathia, Kuroda and Ivan Nova. David Phelps, Adam Warren, Michael Pineda and Vidal Nuno are in the mix for the No. 5 slot.

Tanaka was 99-35 with a 2.30 ERA in seven seasons with the Golden Eagles, striking out 1,238 in 1315 innings. Yankees official has tracked him since 2007, scouting 15 of his games. They sent an eight-person delegation to meet with him Jan. 8 in Beverly Hills, Calif.

''He's got an assortment of quality pitches. He's fastball, slider, split. Throws a cutter, too,'' said pitcher coach Larry Rothschild, who attended the session. ''He's showed tenacity on the mound. When he got in tougher situations, you could see he dialed it up.''

Tanaka's agreement calls for $22 million in each of the first six seasons and $23 million in 2020, and it allows the pitcher to terminate the deal after the 2017 season and become a free agent. He also gets a full no-trade provision.

Story continues