But because of the agility of our total home strategy, we were able to capitalize on pro demand driving growth of 21% this quarter and 49% on a two year basis.
This level of pro growth would not have been possible without our intense focus on the pro customer over the past 24 months.
And at Lowes.com, sales grew 7% on top of 135% growth in the second quarter of 2020, which represents a 9% sales penetration this quarter and a two year comp of 151%.
And we delivered strong positive comps across kitchen and bath, flooring, appliances and decor on top of 20% growth in these categories last year.
The 17% growth we experienced in ticket over $500 was in large part driven by these categories, reflecting continued consumer confidence in investing in their homes.
And during the quarter, operating margin expanded approximately 80 basis points leading to diluted earnings per share of $4.25, which is a 13% increase as compared to adjusted diluted earnings per share in the prior year.
U.S. comparable sales were down 2.2% in the second quarter but up 32% on a two year basis.
However, growth was broad-based on a two year basis with all product categories up more than 15% in that time frame.
By leveraging our total home strategy, we delivered positive comps across appliances, kitchens and bath, flooring and decor on top of over 20% growth in these categories last year.
1 position in appliances, we delivered strong comps in the category this quarter with particularly standout performance in washers and dryers as well as refrigerators and freezers.
We were very pleased that our customers took advantage of the strong product offerings to help make the most out of their outdoor living spaces In this quarter, we delivered over 30% growth in battery-operated outdoor power equipment.
1 position in outdoor power equipment and they truly complement our other leading brands such as John Deere, Honda, Husqvarna, Aaron's and CRAFTSMAN.
As Marvin previously discussed, we delivered strong sales growth of 7% and a two year growth of 151% on Lowes.com.
I'm pleased to announce that for the sixth consecutive quarter, 100% of our stores earned a Winning Together profit-sharing bonus, resulting in a $91 million expected payout to our frontline hourly associates.
And because our efforts once again exceeded expectations, this represents an incremental $20 million over the target payment level.
This year, we've installed our homegrown self-checkout solution in over 550 stores that did not have any self-checkout capability for our customers.
As previously discussed, our online penetration for the quarter was 9%.
And with approximately 60% of online orders picked up in the store, our dedicated in-store fulfillment teams are an integral part of the Lowe's omnichannel customer experience.
As discussed earlier, pro continues to outpace DIY with pro comps of 21% for the quarter and 49% on a two year basis.
In the second quarter, we generated $2 billion in free cash flow driven by continued strong operational execution and consumer demand.
We returned $3.6 billion to our shareholders through a combination of both dividends and share repurchases.
During the quarter, we paid $430 million in dividends at $0.60 per share and we announced a 33% dividend increase to $0.80 per share for the dividend paid on August 4.
Additionally, we repurchased 16.4 million shares for $3.1 billion and we have $13.6 billion remaining on our share repurchase authorization.
Capital expenditures totaled $385 million in the quarter as we invest in the business to support our strategic growth initiatives.
We ended the quarter with $4.8 billion in cash and cash equivalents on the balance sheet, which remains extremely healthy.
At quarter end, adjusted debt-to-EBITDAR stands at 2.08 times, well below our long-term stated target of 2.75 times.
In Q2, we generated diluted earnings per share of $4.25, an increase of 13% compared to adjusted diluted earnings per share last year.
Q2 sales were $27.6 billion with a comparable sales decline of 1.6%.
Comparable average ticket increased 11.3% driven by over 400 basis points of commodity inflation, mostly in lumber, as well as higher sales of appliances and installations.
This was offset by comp transaction count declining 12.9% due to lower sales to DIY customers of smaller ticket items like cleaning products, paint, mulch and live goods.
Keep in mind that comp transactions increased 22.6% last year, which results in a two year comp transaction count increase of 6.8%.
As Marvin indicated, our investments in our total home strategy gave us the ability to pivot during the quarter and led to outperformance in many of our key growth areas with pro up 21%, online up 7%, installation services up 10% and strong positive comps across DIY decor categories.
comp sales were down 2.2% in the quarter but up 32% on a two year basis.
Our U.S. monthly comps were negative 6.4% in May, negative 1.8% in June and a positive 2.6% in July.
Looking at U.S. comp growth on a two year basis from 2019 to '21, May sales increased 32 and a half percent, June increased 32% and July increased 31 and a half percent.
Gross margin was 33.8%.
As expected, gross margin rate declined 30 basis points from last year but was up 165 basis points as compared to Q2 of '19.
Product margin rate improved 40 basis points.
Also, higher credit revenue drove 30 basis points of benefit to gross margin this quarter.
These benefits were offset by 20 basis points of pressure from shrink and live good damages from the extreme weather conditions in the West, also 25 basis points of mix pressure related to lumber and 20 basis points from less favorable product mix in other categories.
Supply chain costs also pressured margin by 35 basis points as we absorbed some elevated distribution costs and continue to expand our omnichannel capabilities.
SG&A at 17% of sales levered 135 basis points versus LY driven primarily by lower COVID-related costs.
We incurred $25 million of COVID-related expenses in the quarter as compared to $430 million of COVID-related expenses last year.
The $405 million reduction in these expenses generated 145 basis points of SG&A leverage.
These benefits were offset by 20 basis points of pressure from higher overall employee healthcare costs.
Operating profit was $4.2 billion, an increase of 6% over LY.
Operating margins of 15.3% of sales for the quarter was up 80 basis points to the prior year.
The effective tax rate was 24.4% and it was in line with prior year.
At the end of the quarter, inventory was $17.3 billion, down $1.1 billion from Q1 and in line with seasonal trends.
This reflects an increase of $3.5 billion from Q2 of 2020 when our in-stock positions were pressured due to elevated demand levels and COVID-related supply disruption.
Current inventory includes a year-over-year increase of $665 million related to inflation, the majority of which is attributable to lumber.
Now, in this revised scenario, we expect Lowe's to deliver sales of approximately $92 billion for the year, representing two year comparable sales growth of approximately 30%.
With elevated sales levels projected and our current productivity efforts taking hold, we are now raising our outlook for operating income margin to 12.2% for the full year.
And as such, we now expect to incur higher-than-planned incentive compensation, resulting in 20 basis points of pressure.
Together, these expenses represent 30 basis points of operating margin deleverage relative to the $92 billion revenue outlook.
Without these offsets in expenses, we would be expecting an operating income margin of 12 and a half percent for the full year.
When I consider our outlook for the business for the remainder of this year, I'm very pleased that we are now expected to deliver approximately 145 basis points of operating margin improvement over 2020.
We are planning for capital expenditures of $2 billion for the year.
Furthermore, we expect to execute a minimum of $9 billion in share repurchases.

Summary:
And during the quarter, operating margin expanded approximately 80 basis points leading to diluted earnings per share of $4.25, which is a 13% increase as compared to adjusted diluted earnings per share in the prior year.
U.S. comparable sales were down 2.2% in the second quarter but up 32% on a two year basis.
In the second quarter, we generated $2 billion in free cash flow driven by continued strong operational execution and consumer demand.
In Q2, we generated diluted earnings per share of $4.25, an increase of 13% compared to adjusted diluted earnings per share last year.
Q2 sales were $27.6 billion with a comparable sales decline of 1.6%.
comp sales were down 2.2% in the quarter but up 32% on a two year basis.
Now, in this revised scenario, we expect Lowe's to deliver sales of approximately $92 billion for the year, representing two year comparable sales growth of approximately 30%.
Together, these expenses represent 30 basis points of operating margin deleverage relative to the $92 billion revenue outlook.
We are planning for capital expenditures of $2 billion for the year.
Furthermore, we expect to execute a minimum of $9 billion in share repurchases.