Dashon Goldson wanted to stay with the 49ers and earn $8 million a year.

Well, one of two isn’t shabby, particularly when considering the former 49ers safety received the boatload of cash he was seeking Wednesday.

Goldson, 28, signed a five-year deal with the Buccaneers for $41.25 million with $22 million guaranteed, ESPN reported.

Goldson was able to cash in based on his performance the past two years, which included two Pro Bowl berths, a first-team All-Pro nod in 2012 and nine interceptions.

In 2011, Goldson, seeking similar money, returned to the 49ers on a one-year, $2 million contract. Last year, he earned $6.2 million as the team’s franchise player. Two days after the Super Bowl, he made it clear that he had no interest in playing under the franchise tag for a second straight season. He would have earned $7.45 million if the 49ers had designated him their franchise player in 2013.

“I was very thankful I didn’t get the franchise tag again, just so I could see my opportunities out there,” Goldson said at his introductory news conference. “I think this is the correct fit. I really truly believe that. It was time to go somewhere that really, really wanted me.”