TAMPA, Fla. -- When the New York Yankees signed Jacoby Ellsbury as a free agent early in December, it appeared that Brett Gardner's days in pinstripes were numbered.

But scarcely more than two months later, and without having played in so much as a spring training game, the Yankees and Gardner have reached an agreement that is likely to keep him with the club through 2018, and perhaps beyond.

The Yankees announced Sunday that they had signed Gardner, 30, to a four-year contract extension worth $50 million, with a club option for a fifth year.

A $2 million buyout clause if the Yankees decide not to exercise the option brings the total value of the deal to $52 million. Gardner does not have a no-trade clause, but the Yankees are obligated to pay him an additional bonus of $1 million in the event they do trade him.

"It's a demonstration from our end," Yankees general manager Brian Cashman said. "We don't typically do this, but it shows the level of confidence, belief and trust in the type of person and player he is, and we're excited to know he's going to be part of this thing going forward."

"I don't want to be anywhere else," Gardner said. "There's no better place to play baseball than in New York. I've never been anywhere else. I got drafted here almost nine years ago, and I love it here. I love everybody in the organization, the coaching staff and all my teammates, and this is where I want to be."

The Yankees typically do not extend existing contracts, although they did attempt to negotiate an extension with Russell Martin before the 2012 season and attempted to initiate conversations with Robinson Cano last spring. Both players rejected the offers and wound up leaving via free agency.

And despite signing Ellsbury -- like Gardner, a center fielder by trade, a leadoff hitter by inclination and a player whose game centers around speed -- the Yankees wanted to make sure they did not suffer the same fate with Gardner, the last everyday position player to come through their farm system in the past decade.

Brett Gardner had 24 stolen bases last season, his sixth with the Yankees. Rich Schultz/Getty Images

So while speculation arose among baseball people that Gardner would soon be traded, Cashman was initiating talks with the outfielder's agent, Joe Bick, trying to keep him a Yankee for the next five years at least. The two sides continued to talk over the past couple of weeks, culminating in the agreement being reached Sunday afternoon.

"That was me trying to reassure them despite the acquisition of Ellsbury of how much we really like Brett," Cashman said. "I'm just repeating what I said in the winter; I love everything about Gardy. I think he's part of the solution here. He would be a leadoff hitter and playing center field for most organizations."

With Ellsbury here, however, Gardner will play left field and likely bat ninth, and by signing now, probably got less money than he would have gotten had he chosen to test the free-agent market at the end of this season. Ellsbury signed for seven years and $153 million.

"Free agency is something that, it kind of intrigued me, and it also kind of scared me," Gardner said. "It's probably the biggest decision I ever had to make in my life. I put a lot of thought into it, but at the end of the day, it's a lot of money.

"Where I come from, that money or twice that much money, I'm not going to change the way I live my life."

Gardner said his decision was based more on wanting to stay with the only professional baseball organization he has ever worked for.

"It's meaningful being able to play for New York, and hopefully one day I can retire and say that I didn't play for another team," Gardner said. "I think that would be awesome. There's definitely a lot more media to deal with on a daily basis, and it seems like a lot more on the line day in and day out, but it's something that I enjoy and it's something that I take a lot of pride in. I love putting on these pinstripes every day."

Gardner is a career .268 hitter who tied for the AL lead in stolen bases, 49, with Coco Crisp in 2011.

"I think Brett has that type of dynamic speed and defense and the ability to get on base that would fit with any franchise, whether you're an older station-to-station club or if you're a National League team that typically needs a guy like this," Cashman said. "He fits on any team."