A Tim Hortons location in Calgary is shown here. The iconic Canadian brand boosted profits by 21 per cent last quarter. ((Kelsey Hipkin/CBC))

Tim Hortons Inc. reported on Thursday a 21 per cent gain in profits, something it calls its best three-month performance in several quarters.

The iconic Canadian coffee chain earned $94.1 million, up from $77.8 million a year ago.

The company showed improvement in the key retail metric of same-store sales. In Canada, sales at stores open more than a year were 6.4 per cent higher. In the U.S., same-store sales growth was 3.1 per cent.

"The strength of our same-store sales growth in the U.S. was gratifying, given continued economic challenges in that market," CEO Don Schroeder said.

"We continue to make excellent progress on our growth initiatives and we believe our business is well positioned to continue to drive shareholder value."

The company also declared a common dividend of $0.13 per share, payable on Sept. 8, 2010 to shareholders of record as of Aug. 23, 2010.

In a separate announcement, Tim Hortons said it plans to sell its stake in a bakery for nearly half a billion dollars.

The company will sell its 50 per cent interest in Maidstone Bakeries to its joint venture partner Aryzta AG for $475 million.

The company noted that it still has supply agreements with the bakery that extend until at least early 2016.

"The team at Maidstone Bakeries have been very committed to our business and have provided our restaurant owners with high-quality products and excellent support," Schroeder said.

"We look forward to working with them after the closing of this transaction."