The favorable pricing environment, along with continued strong underlying demand in the majority of the end markets we serve, drove record quarterly net sales of $3.42 billion.
Through continued price discipline by our managers in the field, we generated a strong gross profit margin of 31.7%, which, when combined with our record sales, resulted in a record quarterly gross profit of $1.08 billion in the second quarter of 2021.
Both our record quarterly gross profit and our continued focus on expense control contributed to our second consecutive quarter of record quarterly pre-tax income of $444.1 million.
Our quarterly earnings per diluted share of $5.08 were both another record and substantially in excess of our guidance as well as up 23.3% from our prior quarter.
We most recently increased our long-term sustainable gross profit margin range to 28% to 30% during the first quarter of 2020.
Today, we are very pleased to announce that we are once again increasing our estimated sustainable gross profit margin range to 29% to 31%.
Over the past five years, we have invested nearly $1 billion into our company through capital expenditures.
These investments not only introduced new processing capabilities and helped us increase the percentage of orders with processing from our historic levels of about 40% to our current level of about 50%, but also enhanced and upgraded our existing value-added processing equipment to improve the quality of our service offerings to our customers.
As such, we are increasing our 2021 capital expenditure budget from $245 million to a new record of $310 million due to various key projects, including a significant expansion of our operation in South Korea that services the semiconductor and biochem and pharma markets, new expansion -- with new expanded toll processing capacity and increased investments in renewable energy at many of our existing facilities.
During the second quarter of 2021, we invested $80.1 million in capital expenditures.
In regard to stockholder returns, we returned $67.8 million to our stockholders during the second quarter of 2021 through the payment of $43.8 million in dividends and the repurchase of $24 million of Reliance common stock.
Since 2018, we have repurchased approximately $900 million of our common stock at a weighted average cost at $85.52 per share.
Effective January 2022, Bill Sales will retire from Reliance following 24 years of service with our company.
Continued strong underlying demand in the majority of our end markets resulted in our tons sold increasing 1% compared to the first quarter, which was within our guidance range of flat to up 2%.
Our average selling price in the second quarter reached a new all-time high an increased 19.7% compared to the first quarter of 2021 and exceeded our guidance of up 5% to 7% by a significant amount.
As Jim noted, the robust demand and favorable pricing conditions contributed to record quarterly gross profit dollars of $1.08 billion in the second quarter of 2021 and a strong gross profit margin of 31.7%.
On a FIFO basis, which we believe better reflects our current operating performance, we achieved a record gross profit margin of 37.5%, our second consecutive record FIFO gross profit margin quarter.
The significant increase in metal pricing and ongoing strength in demand resulted in record quarterly sales of $3.42 billion, up 20.4% from the first quarter of 2021 and up 69.3% from the second quarter of 2020.
Strong pricing momentum for most carbon and stainless steel products contributed to the 19.7% increase in our average selling price per ton over the first quarter of 2021.
As Jim and Karla mentioned, the continued pricing discipline and focus on higher-margin orders by our managers in the field, along with our ongoing investments in value-added processing capabilities collectively resulted in record quarterly gross profit of $1.08 billion and a strong gross profit margin of 31.7% in the second quarter of 2021.
Our non-GAAP FIFO gross profit margin of 37.5% in the second quarter of 2021 was a record and exceeded the prior quarter by 40 basis points, and the prior year period by 730 basis points.
We incurred LIFO expense of $200 million or $2.31 per share in the second quarter of 2021 compared to LIFO expense of $100 million or $1.16 per share in the first quarter of 2021.
As a result of higher-than-anticipated costs for certain carbon and stainless steel products, we revised our annual LIFO expense estimate to $600 million from $400 million for 2021.
and had to true up to our new annual estimate in the second quarter of 2021 by incurring $200 million of LIFO expense, bringing our six-month 2021 LIFO expense to $300 million.
Our current projected LIFO expense for the third quarter of 2021 is $150 million based on this revised annual LIFO expense estimate.
At the end of the second quarter of 2021, our LIFO reserve on our balance sheet was $415.6 million and is projected to be $715.6 million at December 31, 2021, based on our current $600 million annual LIFO expense estimate.
Our second quarter SG&A expense increased $44.8 million or 8.6% compared to the first quarter of 2021.
In comparison to the prior year period, SG&A expense was up $124.8 million or 28.5% primarily as a result of higher incentive-based compensation, variable plant and delivery expenses associated with a 17.5% increase in shipments, and to a lesser extent, inflationary increases.
Our non-GAAP pre-tax income of $442.8 million in the second quarter of 2021 was the highest in our company's history.
Our non-GAAP pre-tax income margin of 13% was also a record.
Our effective income tax rate for the second quarter of 2021 was 25.6%, up from 20.9% in the second quarter of 2020, mainly due to higher profitability.
We currently anticipate a full year 2021 effective income tax rate of 25.5%.
We generated record quarterly earnings per share of $5.08 in the second quarter of 2021 compared to $4.12 in the first quarter of 2021 and $1.24 in the second quarter of 2020.
In the second quarter, we again generated strong cash flow from operations of $101.6 million despite over $300 million in additional working capital requirements.
In addition, our second quarter of 2021 cash flow from operations was impacted by approximately $174 million of income tax payments compared to $7 million in the first quarter of 2021.
As of June 30, 2021, our total debt outstanding was $1.66 billion, resulting in a net debt to EBITDA multiple of 0.7 times.
We had no borrowings outstanding on our $1.5 billion revolving credit facility, providing us with ample liquidity to continue executing on all areas of our capital allocation strategy while maintaining our investment-grade credit ratings.
As such, we estimate tons sold will be down 1% to up 1% in the third quarter of 2021 compared to the second quarter of 2021.
As metal prices at the beginning of the third quarter of 2021 are higher than the average for the second quarter of 2021, we estimate our average selling price per ton sold for the third quarter of 2021 will be up 7% to 9%.
Based on these expectations, we currently anticipate non-GAAP earnings per diluted share in the range of $5.55 to $5.75 for the third quarter of 2021.

Summary:
Our quarterly earnings per diluted share of $5.08 were both another record and substantially in excess of our guidance as well as up 23.3% from our prior quarter.
The significant increase in metal pricing and ongoing strength in demand resulted in record quarterly sales of $3.42 billion, up 20.4% from the first quarter of 2021 and up 69.3% from the second quarter of 2020.
We generated record quarterly earnings per share of $5.08 in the second quarter of 2021 compared to $4.12 in the first quarter of 2021 and $1.24 in the second quarter of 2020.
Based on these expectations, we currently anticipate non-GAAP earnings per diluted share in the range of $5.55 to $5.75 for the third quarter of 2021.