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

New York capped an offseason spending spree by agreeing Wednes day 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?"

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.

Tanaka receives a $35,000 moving allowance, an annual $100,000 housing allowance to be used in New York or near the team’s spring training facility in Tampa, Fla., and an interpreter of the pitcher’s choice at an $85,000 yearly salary. In addition to his own flight to the U.S., Tanaka annually will be provided four first-class round trip tickets between New York and Japan.