After a flirtation that lasted months with Joe Gibbs Racing, Carl Edwards has decided to remain at Roush Fenway Racing beyond the 2011 NASCAR Sprint Cup Series season.

The team announced Thursday morning that it had re-signed the 31-year-old driver to a “multi-year agreement starting in 2012.”

Financial terms of the agreement were not announced.

Edwards, who has won 19 Cup races with Roush and currently leads the series points standings, opted to remain with the organization he is comfortable with and the one that launched his NASCAR career.

“I sincerely appreciate the amazing opportunity that Jack Roush has given me in this sport and am honored to race for him,” Edwards said. “As an organization, Roush Fenway provides the resources I need to win, and as a driver, that’s the most important thing.

“We’re having a fun season on the race track as we’re leading the points and in great position for the Chase. That’s the result of a lot of hard work from the men and women at Roush Fenway, Ford Motor Company and Roush Yates Engines. I really enjoy competing with this group and looking forward to continuing that relationship into the future.”

Edwards, who began his career with Roush in 2003 in NASCAR’s truck series, has spent the last several months under the microscope while considering whether to re-sign with Roush or leave for another team. He declined to discuss contract negotiations as they progressed, saying he preferred to keep the matter private.

In the end, he decided to sign a new long-term contract with Roush. He likely will have funding from current primary sponsor Aflac as well as another major sponsor.

“Carl Edwards has achieved a level of success on and off track that would put him at the top of the list for any race team,” Roush Fenway Racing co-owner Jack Roush said. “Carl and the No. 99 team are having a terrific season again this year, and we’re thrilled that our relationship will continue for many more.

“We saw great potential in Carl a decade ago, and it’s been a thrill to watch him grow into one of the sports’ premier drivers. We didn’t take our past success for granted when we sat down with Carl to talk about his future. As an organization, we approach each week with an intense focus on being successful in the race to come. Carl’s position atop the points is a testament to that diligence.”

Edwards was considered the most coveted free agent this year. In addition to a third-place finish in the Cup standings in 2005 and a second-place finish in points in 2008, he has won a Nationwide Series title and has 59 victories across NASCAR’s three national stock-car touring series.

Keeping Edwards in-house is huge for Roush Fenway, which has had three drivers – Greg Biffle, Matt Kenseth and David Ragan – under contract for next year but only one sponsorship, with 3M aligned with Biffle.

Kenseth’s sponsor, Crown Royal, announced recently that it wouldn’t return next year. Ragan sponsor UPS has not said whether it would return next year but has indicated to Roush Fenway officials that it likely won’t fund all 36 races as a primary sponsor.

Signing Edwards should help boost the team’s profile with potential sponsors for Kenseth and Ragan.

“Carl brings a tremendous amount to the table from both a marketing and competitive standpoint,” Roush Fenway president Steve Newmark said. “He has one of the largest fan bases in the sport, is able accomplish so much for his sponsors and is second to none on the race track. We’re proud to have Carl as part of our roster going forward, a roster that includes some of the most experienced veteran champions on the circuit, and some of the sport’s most promising up-and-coming drivers.”

Jamie Allison, director of Ford Racing, said Edwards’ decision was “a vote of confidence” for both Roush Fenway and Ford.

“This signals he believes he is with the right team and the right automaker to win races and championships,” Allison said. “Now we can continue to focus on winning the 2011 championship.”