TJ Maxx was a retail bright spot during the holidays

Retail has had scant bright spots lately, but T.J. Maxx parent TJX Companies  (TJX - Get Report)  offered cause to celebrate.

Fourth quarter sales clocked in at $9.5 billion, up 6% year over year, and ahead of estimates for $4.44 billion. Earnings of $1.03 a share beat forecasts for $1.00 a share. 

"We were particularly pleased that customer traffic was the primary driver of our comp increases at every major division, which tells us that our eclectic merchandise mix and amazing values continue to resonate with consumers across our geographies," CEO Ernie Herman said in a statement, noting that 40-year-old TJX has reported comparable sales increases for 21 straight years.

Shares of TJX rose slightly in early trading to $76.33.

Net sales of $33.2 billion for the year represented a 7% increase, while comparable sales rose 5% for the off-price retailer of apparel and home products. Earnings of $3.53 a share, which were adjusted for debt extinguishment and pension charges, topped last year's $3.33 a share, as well as analysts' expectations. According to FactSet, analysts expected the company to earn $3.51 a share in the fiscal year on sales of $33.16 billion.

TJX bought back 6.9 million shares in the fourth quarter and a whopping 22.3 million in fiscal 2017, spending $525 million and $1.7 billion, respectively. The company increased its existing stock repurchase plan (of which $1.8 billion remains), approving an additional $1 billion, as well as increasing its quarterly dividend 20% to 31.25 cents per share.

Jim Cramer and the AAP team hold a position in TJX Companies for their Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells TJX? Learn more now.

During the 53-week 2018 fiscal year, which ends Feb. 3, 2018, TJX expects to earn $3.80 to $3.89 a share, or $3.69 to $3.78 on a 52-week basis. Wall Street had estimated $3.80 a share.