ST. PETERSBURG -- James Shields is going to be with the Rays for a long time.

As expected Wednesday afternoon, the Rays announced at a news conference they had signed their prized right-hander to a long-term deal that could last as long as seven years and -- with incentives -- could be worth as much as $44 million.

"I had no idea [the deal would be this long]; it really shocked me at first," said Shields, 26, who went 12-8 with a 3.85 ERA in 2007. "They're committed to me, and I love it, and I'm committed to them. It's one of those things where I love this city, I love this organization, and I like what they're doing and I like where they're going."

The contract is guaranteed for four years, with the Rays holding three consecutive one-year options that would keep Shields on the Rays through the 2014 season.

"For me, it's more about being able to stay with one team for a long time," Shields said. "I see all these guys getting traded every year, every other year, and it's tough on the families, it's tough on the players, it's tough on everyone. So being here for seven years, I think it's a great deal for me. I think it's a great deal for everyone. And I couldn't be happier."

The contract is potentially the longest in club history. As part of the deal, Shields will donate $650,000 to the Rays Foundation, the team's charitable foundation that supports youth and education programs in the Tampa Bay region.

"This signing is yet another indication of our deep commitment to building and maintaining the young nucleus of the Tampa Bay Rays," said Andrew Friedman, Rays executive vice president of baseball operations. "It also shows James' desire to be a key part of that nucleus for many years to come. Not only has he developed into one of the most consistent young starting pitchers in the American League, but his work ethic and competitiveness are exemplary. We look forward to him continuing to grow as one of the leaders of our team and as a key player in our future success."

Extraordinary is the fact Shields landed such a deal after just a year and a half of Major League experience under his belt, two seasons shy of becoming arbitration-eligible and five seasons from free agency (2013).

Hot Stove

"Obviously, signing a pitcher to a long-term deal is riskier than signing a position player," Friedman said. "But that being said, you need pitching to win. And we feel like as our nucleus continues to develop and the longer we can keep these guys in place, the better our chances are of sustaining our ultimate success."

The genesis of the deal came when Shields asked his agent, Page Odle, in October if he would explore the chances of getting a long-term deal.

"Page contacted me about it," Friedman said. "It was something, more times than not, we would have waited a season or two. But with Jamie's talent, with his work ethic, we felt comfortable taking that risk earlier on. But it's certainly unusual signing a pitcher this early in his service time."

Friedman added that one of the most critical elements to making such a deal is "knowing your own players."

"Knowing which ones won't be adversely affected by getting the money this early and stay just as hungry," Friedman said. "We feel like we know Jamie very well, and we feel extremely confident he'll continue doing exactly what he's done. And also, he'll continue to get better."

The signing will also serve as a billboard for working hard.

"For us, we really like the message it sends as we continue to try to develop our Rays way of doing things," Friedman said. "Having guys appreciate what it takes to get here, what it takes to stay here, and more importantly, what it takes to get a long-term contract."

Shields was the team's most consistent pitcher last season after going undefeated in his first 13 starts, making him only the 17th pitcher in the past 25 years to accomplish that feat. During that period, Shields exited all 13 games with either the lead or the game tied but went just 6-0 with a 3.05 ERA -- thanks in large part to the bullpen's struggles to protect the lead.

He went 2-7 in his next 10 starts before finishing the season strong, going 4-1 with a 2.20 ERA in his last eight starts.

While Shields has quality stuff, he is a blue-collar pitcher in that he doesn't like to leave a game. He became the third pitcher in team history to eclipse the 200-innings mark, finishing 10th in the American League in innings pitched with a team-high 215, despite missing his last two starts when the Rays chose to take a cautious approach. Wednesday, Shields teased that he still was mad about the team shutting down his 2007 season early, because he wants the baseball.

The highlight of Shields' season came on May 30, when he threw the first nine-inning complete game of his career against the Tigers in a 5-3 win at Tropicana Field. The effort typified Shields' toughness as he survived a three-run, five-hit first inning to retire 24 of the final 27 batters he faced.

Shields has become known as a pitcher who throws strikes and doesn't walk many, which occasionally bites him in the way of home runs. He allowed 28 homers last season, tying him for the third-highest total in the American League. Conversely, he walked only 36 batters while striking out 184, and his 10.38 baserunners per nine innings ranked third in the AL.

Already, the Rays' payroll has surpassed $40 million for the 2008 season after having an Opening Day payroll last season of $24 million. Signing Shields obviously pushes that figure higher.

Last week, the Rays avoided arbitration with Jonny Gomes, Dan Wheeler and Scott Kazmir by signing each to a one-year deal, and they signed Carlos Pena to a three-year, $24.125 million pact.

Since the ownership group headed by Stuart Sternberg got involved with the team, the Rays have inked several of the organization's key players to long-term deals, beginning with Carl Crawford and Rocco Baldelli.

"I think all the fans need to understand that we're really trying to win around here," Shields said. "We're not messing around."