May 8 (Reuters) - Green Mountain Coffee Roasters Inc , maker of Keurig single-serve brewers and K-Cups, raised its full-year earnings outlook on Wednesday after a better-than-expected second quarter and said it had expanded its relationship with Starbucks Corp, sending its shares up almost 16 percent after hours.

The new 5-year agreement, which replaces one first signed in 2011, triples the number of Starbucks drinks to be sold in K-Cups with the addition of Seattle’s Best and Torrefazione Italia coffees, Teavana teas and Starbucks cocoa.

It also ends speculation that Starbucks might walk away from their partnership following the expiration of certain Green Mountain patents and the launch of Starbucks’ own single-serve brewer of espresso drinks.

“Starbucks is the largest coffee brand out there. Them coming and saying ‘we want a long-term deal with you’ is a very good thing for our system,” Brian Kelley, Green Mountain’s chief executive, told Reuters. “This certainly puts away any fear that the Keurig system isn’t the winning system.”

The exact expiration date of the prior agreement is not known, but it was slated to last at least through most of 2014. The new agreement is for at least five years, starting now.

“The Starbucks deal changes the conversation to longer-term opportunities,” said Marc Riddick, an analyst with The Williams Capital Group. “It further confirms our belief that K-Cups are a growth driver for many strong companies, not just Green Mountain.”

Starbucks shares rose nearly 1 percent after hours.

Green Mountain’s net income was $132.4 million, or 87 cents per share, in its fiscal second quarter ended on March 30, up from $93.0 million, or 58 cents per share, a year earlier.

Excluding certain costs, earnings were 93 cents per share. On that basis, analysts, on average, had been expecting 74 cents per share, according to Thomson Reuters I/B/E/S.

Net sales rose 14 percent to $1.00 billion, as a 21 percent increase in K-Cups offset a 10 percent decline in sales of brewers and accessories.

Green Mountain sells its brewers virtually at cost to fuel adoption of its system. It makes the vast majority of its profits from the K-Cups.

Last year, certain of the company’s design patents expired, inviting a host of private-label competitors and raising concerns among investors that an erosion of its dominant market share would hurt its pricing power and margins.

For the current third quarter, Green Mountain said it expects earnings of 71 cents to 78 cents per share and net sales growth of 11 percent to 15 percent.

For the full year, it now expects earnings of $3.05 to $3.15 per share, excluding items, and net sales growth of 11 percent to 14 percent.

It had previously forecast earnings of $2.72 to $2.82 per share on net sales growth of 15 percent to 20 percent. The company said the lower sales growth is due largely to the shrinking of its more traditional bagged coffee business, which is being replaced by its single-serve Keurig business.