The favorable pricing environment, along with fundamentally strong underlying demand in many of the key end markets we serve drove record quarterly net sales of $3.85 billion.
In addition, strict pricing discipline by our managers in the field helped us generate a strong gross profit margin of 31.5%, which, when combined with our record sales, resulted in a record quarterly gross profit dollars of $1.21 billion in the third quarter of 2021.
Despite various supply disruptions and continued increases in metals pricing that drove LIFO expenses of $262.5 million in the third quarter, our record quarterly net sales, along with record gross profit dollars and our continued focus on expense control led to the third consecutive quarter of record quarterly pre-tax income of $532.6 million.
As a result, our earnings per diluted share of $6.15 were also a record, representing an increase of 21.1% from our record earnings per share achieved in the prior quarter and substantially exceeded both our guidance and analyst consensus.
We estimate that approximately half of our $310 million capital expenditure budget this year will be directed toward new, innovative, value-added processing equipment, along with enhancements to existing equipment to strengthen our value proposition and overall service offerings.
On October 1st, we completed our acquisition of Merfish United, a leading master distributor of tubular building products in the U.S. The company is based in Massachusetts and services 47 states through 12 strategically located distribution centers.
The Merfish transaction is a bit unique, in that Merfish is not a traditional metal service center and yet the transaction is one of the larger acquisitions that we have completed in our history, as Merfish had approximately $600 million in annual net sales in the 12-month period ending September 30, 2021.
During the third quarter of 2021, we also returned $174.7 million to our stockholders through the payment of $43.7 million in dividends and the repurchase of $131 million of Reliance common stock at an average cost of $147.89 per share.
In the last five years, Reliance repurchased 11.7 million shares of our common stock at an average cost of $89.92 per share for a total of $1.05 billion.
Reliance is a Delaware corporation operating through approximately 300 divisions and subsidiary locations in 40 states and 13 countries outside of the United States, and the relocation of Reliance's principal executive office to Scottsdale reflects our growth and expansion as well as our evaluation of post-pandemic business opportunities and related operating practicalities.
Dave has been a strategic and valued partner to Reliance for more than 30 years for his involvement in the metals industry, and Frank is a seasoned and respected public company senior executive and Chief Financial Officer.
With the addition of Dave and Frank, Reliance's Board consists of 12 members, 10 of whom are independent.
despite the challenges of the ongoing pandemic, supply chain disruptions and tight labor markets and limited metal availability, we sustained our efforts to ensure that we continued to provide value customers with the products they need, often in 24 hours or less.
Our tons sold decreased 4.6% and from the second quarter, which was below our guidance of down one percent to up one percent, mainly due to more typical seasonality than we had anticipated combined with various supply chain issues.
Our average selling price per tons sold in the third quarter reached another all-time high of $2,862, an increase of 18.4% compared to the second quarter of 2021 and significantly in excess of our guidance of up seven percent to nine percent.
The favorable pricing environment, coupled with outstanding execution by our managers in the field, contributed to record quarterly gross profit dollars of $1.21 billion in the third quarter of 2021 and a strong gross profit margin of 31.5%.
On a FIFO basis, which we believe better reflects our current operating performance, we achieved a record gross profit margin of 38.3% marking our third consecutive quarter of record FIFO gross profit margin.
Favorable metals pricing fueled by limited availability and solid demand trends in the vast majority of key end markets we serve resulted in record quarterly sales of $3.85 billion, up 12.5% from the second quarter of 2021 and up 84.5% from the third quarter of 2020.
Strong pricing momentum contributed to the 18.4% increase in our average selling price per tons sold over the second quarter of 2021.
In comparison to the same period of the prior year, our average selling price per tons sold was up 77.9% due to increases in metal prices, but the vast majority of the products we sell, notably carbon and stainless steel products.
As Karla noted, Reliance has limited exposure to the more volatile and lower-margin hot-rolled coil and sheet products that made up only about 11% of our third quarter sales.
While benchmark pricing for hot-rolled coil products was up over 275% from the third quarter of 2020, Reliance's average selling price per tons sold for the same period was up 77.9%.
These factors collectively resulted in record quarterly gross profit of $1.21 billion and a strong gross profit margin of 31.5% in the third quarter of 2021 despite including a significant LIFO charge.
Our non-GAAP FIFO gross profit margin of 38.3% in the third quarter of 2021 was a record and exceeded the prior quarter by 80 basis points and the prior year period by 650 basis points.
We incurred LIFO expense of $262.5 million in the third quarter of 2021 compared to $200 million in the second quarter of 2021.
LIFO expense in effect reflects our cost of sales at current replacement costs and removes inventory gains from our results in an environment of rising metal costs and conversely, removes inventory losses from our results in times of declining metal costs.
Our guidance for Q3 2021 assumed LIFO expense of $150 million based on our $600 million annual estimate.
We revised our 2021 annual LIFO expense estimate from $600 million to $750 million.
Accordingly, we had to true up our third quarter 2021 LIFO expense by incurring an incremental charge of $112.5 million, which increased our total third quarter LIFO expense to $262.5 million.
Based on our revised annual LIFO expense estimate, we now project LIFO expense for the fourth quarter of 2021 to be $187.5 million or $2.21 per share and $750 million or $8.73 per share for the full year.
As of today, the LIFO reserve on our balance sheet at the end of this year is expected to be $865.6 million based on our revised $750 million annual LIFO expense estimate.
This provides $865.6 million available to benefit future period operating results, significantly mitigating the impact of declining metal prices on our gross profit and pre-tax income.
Our third quarter SG&A expense increased $43.5 million or 7.7% compared to the second quarter of 2021, and increased $157.6 million or 35.1% compared to the prior year period.
Overall, our headcount increased slightly compared to both the second quarter of 2021 and the third quarter of 2020, but is nonetheless down approximately 11% from pre-pandemic levels at the end of the third quarter of 2019.
As a reminder, approximately 65% of our total SG&A costs are people related.
Our pre-tax income of $532.6 million in the third quarter of 2021 was the highest in our company's history.
Our pre-tax income margin of 13.8% was also a record.
Our effective income tax rate for the third quarter of 2021 was 25.5%, up from 22.6% in the third quarter of 2020, mainly due to higher profitability.
We currently anticipate an effective income tax rate of 25.5% for the full year 2021.
We generated record quarterly earnings per share of $6.15 in the third quarter of 2021 compared to $5.08 in the second quarter of 2021 and $1.51 in the third quarter of 2020.
It's worth emphasizing again that our third quarter 2021 results were impacted by LIFO expense of $3.06 per share.
Our third quarter cash flow from operations was $142.2 million after servicing over $325 million in additional working capital requirements.
As of September 30, 2021, our total debt outstanding was $1.66 billion with a net debt-to-EBITDA multiple of 0.6 times.
We had no borrowings outstanding on our $1.5 billion revolving credit facility and had $638.4 million of cash on hand, providing us with ample liquidity to continue executing on all areas of our capital allocation strategy, including funding our acquisition of Merfish United on October one and our record 2021 capex budget.
In addition, we anticipate demand will be impacted by normal seasonal factors including customer holiday-related shutdown and fewer shipping days in the fourth quarter compared to the third quarter.
As such, we estimate tons sold will be down 5 percent to eight percent in the fourth quarter compared to the third quarter of 2021.
Based on these expectations, we currently anticipate non-GAAP earnings per diluted share in the range of $5.05 to $5.15 for the fourth quarter of 2021.

Summary:
The favorable pricing environment, along with fundamentally strong underlying demand in many of the key end markets we serve drove record quarterly net sales of $3.85 billion.
As a result, our earnings per diluted share of $6.15 were also a record, representing an increase of 21.1% from our record earnings per share achieved in the prior quarter and substantially exceeded both our guidance and analyst consensus.
Our average selling price per tons sold in the third quarter reached another all-time high of $2,862, an increase of 18.4% compared to the second quarter of 2021 and significantly in excess of our guidance of up seven percent to nine percent.
Favorable metals pricing fueled by limited availability and solid demand trends in the vast majority of key end markets we serve resulted in record quarterly sales of $3.85 billion, up 12.5% from the second quarter of 2021 and up 84.5% from the third quarter of 2020.
LIFO expense in effect reflects our cost of sales at current replacement costs and removes inventory gains from our results in an environment of rising metal costs and conversely, removes inventory losses from our results in times of declining metal costs.
We generated record quarterly earnings per share of $6.15 in the third quarter of 2021 compared to $5.08 in the second quarter of 2021 and $1.51 in the third quarter of 2020.
In addition, we anticipate demand will be impacted by normal seasonal factors including customer holiday-related shutdown and fewer shipping days in the fourth quarter compared to the third quarter.
As such, we estimate tons sold will be down 5 percent to eight percent in the fourth quarter compared to the third quarter of 2021.
Based on these expectations, we currently anticipate non-GAAP earnings per diluted share in the range of $5.05 to $5.15 for the fourth quarter of 2021.