SAN FRANCISCO — After a four-hour meeting at AT&T Park last month, the Giants offered to call for a car that would escort Zack Greinke back to his San Francisco hotel. The man who would become the most expensive player in MLB history politely declined, saying he wanted to walk through a city that just a month earlier had considered him a rival. 

Giants officials watched Greinke head downtown, unassuming and unrecognized. In their minds, a thought started to form, one that solidified over the coming weeks. It was a possibility that could shake up the National League and forever change a rivalry: Zack Greinke was going to be a Giant.

Members of the front office were confident after a mid-November meeting in which Greinke blew the Giants away, per sources familiar with the conversation, asking about prospects who were unknown even to some people in the meeting. They were confident over the coming weeks as word leaked that the Giants and Dodgers were the two finalists. They were confident up until the afternoon of Dec. 4, when Ken Rosenthal of Fox Sports reported that the Arizona Diamondbacks had jumped into the mix.

The Diamondbacks, per Rosenthal, made their decision to pursue Greinke and then agreed to terms on a six-year, $206.5 million deal in less than six hours. The move was a shock to the industry, and it altered the rotation plans of two teams trying to end the Dodgers’ reign atop the division.

[PAVLOVIC: Cueto, healthy and relaxed, gives Giants another workhorse]

When Greinke was introduced to the Phoenix media he said that he was “minutes away from going to a different team … it was that close.” It was assumed that Greinke meant the Dodgers, but industry sources have told CSN Bay Area that the Giants are believed to be the “different team,” that Greinke was prepared to choose orange and black when the Diamondbacks swooped in at the last minute.

The surprising Greinke decision was the story of Major League Baseball's offseason, but the story of the Giants’ offseason is a different one. They were not going to come close to the record-setting deal the Diamondbacks offered, but they didn’t let that disappointment linger. Giants officials will remember this month not as the one when Greinke got away, but as the one when Brian Sabean, Bobby Evans and the rest of the front office reshaped the organization’s future in a matter of hours.

“Sometimes you have to be nimble,” team president and CEO Larry Baer said. “We weren’t crying in our beer. We were moving.”

The Giants moved quickly. Hours after the Greinke decision, Jeff Samardzija agreed to a five-year, $90 million deal. Samardzija, per sources, had indicated all along that he was so intent on being a Giant he was willing to wait until after Greinke made a decision. That patience was rewarded.

“Obviously, you have to play it cool, right?” Samardzija said at his introductory press conference. “It’s kind of like being in high school and trying to find a homecoming date. You just don’t want to be left out there in the cold. I was like, ‘I might go to San Fran. I might think about it.’ 

“But, really, in the back of my head, that’s where I wanted to be.”

The Giants had their potential No. 2 starter, but they weren't done. Bryce Dixon, Johnny Cueto’s agent, was the next to get a call. The Giants met with him face-to-face at the winter meetings, four days after losing out on Greinke.

“I give a lot of credit to Bobby and the group,” Baer said. “We immediately (signed) Samardzija and immediately called Cueto.”

In a way, the Diamondbacks had shaped the Giants’ offseason a second time. Cueto was thought to be Arizona’s top target but he reportedly turned down a $120 million offer. Dixon said the Diamondbacks gave his client 48 hours to make a decision.

“We negotiated quickly and then they gave me an ultimatum, and I was still talking to a bunch of teams at the time, and I just didn’t feel like it was the time to pull the trigger on a deal that early when there was so much interest,” Dixon said Thursday.

For months the Giants had talked internally of adding a strong presence behind Madison Bumgarner. They figured Greinke could be the choice, with a mid-tier outfielder rounding out their offseason. When Cueto was still around in early December — at a reasonable price for a pitcher of his caliber — the Giants went all-in on pitching. With a young, cost-controlled infield and a set lineup and bullpen, ownership approved a $220 million spending spree that seemed more fitting for a team like the Yankees or Dodgers. 

“They were extremely supportive,” Baer said. “We’ve been in a situation now here for a lot of years where I can’t think of one time where any owner has said ‘it doesn’t work’ or ‘stop it.’ Everyone wants to win. It’s our job to come up with rational proposals and we spent a lot of time figuring out what’s best in the organization in a rational way. Two arms, spending ($220 million) on the two arms, plus obviously (the Brandon Crawford extension), it’s hard to argue with.

“Everybody (in ownership) was extremely supportive. They want to win, they want to win and get back to the World Series.”

The offseason spending means the Giants will pay the competitive balance tax for the second time after never approaching that mark before 2015. Contracts for starting pitchers — from these two to Matt Cain’s nine-figure deal — have gone a long way in putting the Giants into the tax, but Baer said the sport has come to grips with the fact that spending on starting pitching “is just the world we live in.” Starting pitchers have received more than $900 million in guaranteed contracts this offseason, with several big names still on the market.

The Giants are no strangers to big deals for pitchers, and the Cain and Barry Zito deals didn’t work out as hoped. That clearly didn’t spook ownership. A year after chasing Jon Lester and James Shields, the Giants nearly had Greinke before signing Samardzija and Cueto.

“We are beyond thrilled,” Baer said. “To a person, we asked what single move can we make to improve our chances to get to the World Series and win the World Series. And the one word was 'Cueto.’”

There’s an alternate baseball world where Greinke is a Giant, and it’s hard to tell which situation is better for the Giants going forward. Greinke’s talent is undeniable, but for a similar price the Giants nabbed a pitcher they believe can be just as good (Cueto) and one (Samardzija) they believe can stand right with the Bumgarners and Cuetos of the world.

“In our eyes, there were many different ways to put this roster together. There was never one way we envisioned it,” Evans said this week. “We looked at it in different respects. Anytime you’re mentioning (Greinke, Samardzija and Cueto), in any combination, you know you’re making your team better and stronger. 

“There were some excellent options out there, and we tried to take advantage of it.”