SAN FRANCISCO -- As another tip of the cap to his loyalty, the Giants had Alex Smith throw out the ceremonial first pitch before their playoff opener Saturday night. Willie Mays even gave the 49ers quarterback some advice on how to grip a baseball.

Smith's fastball was incomplete -- it bounced to the right of home plate -- but the AT&T Park crowd gave him a loud ovation anyway.

The Giants have a special place in their hearts for the 49ers quarterback after the NFL threatened to fine Smith $15,000 last month for wearing a Giants cap to his postgame news conferences.

The NFL has restrictions about wearing non-sponsored gear "when visible to the stadium and television audience."

Upon hearing of the threatened fine, manager Bruce Bochy and others donned 49ers caps in support of the quarterback.

As an added reward, Smith got to ring in Game 1 of the National League Division Series against the Cincinnati Reds.

"We certainly appreciate his support wearing a Giants hat," Bochy said. "That's why we wanted to reciprocate and wear a 49ers hat and have some fun with it."

Bochy quipped the Giants might be on a scouting mission, too, because they liked the right-hander's strong arm.

Smith shouldn't expect a contract offer: His velocity was decent -- but the kid was wild.

Only a nice play by his catcher, reliever Sergio Romo, prevented the pitch from skipping to the backstop.

"I'm disgusted with myself," the quarterback joked.

Smith said he took a few warm-up tosses in the days leading up to his appearance but hadn't thrown a baseball off a pitcher's mound since he was about 10.

He prepared by getting some advice from Mays, the Giants Hall of Famer, who visited 49ers practice last week.

"He was trying to help me with my grip," Smith said, smiling. "He's definitely not to blame. I should have listened."

The 49ers quarterback got special permission to leave the team hotel on the eve of a game because he said coach Jim Harbaugh was enthusiastic about the invitation.

Smith even got a police escort to the ballpark.

The 49ers (3-1) face the Buffalo Bills (2-2) on Sunday at Candlestick Park.

That's why right tackle Anthony Davis tweeted in his defense a few minutes after Smith's erratic pitch: "Alex is saving his strikes for tomorrow."