1 priority, which has always been protecting the health and safety of our associates and communities.
And with that in mind, in Q1, we invested nearly $60 million in support of COVID safety protocols.
Our outstanding performance continued this quarter with total company comparable sales growth of 25.9%.
comps were 24.4% with broad-based growth across all geographic regions and divisions.
In fact, for the quarter, comp sales for all 15 U.S. regions exceeded 18% and all U.S. divisions exceeded 20%.
During the quarter, operating margin expanded 313 basis points on an adjusted basis, leading to diluted earnings per share of $3.21, which is an 81% increase on an adjusted basis over the prior year.
On Lowes.com, sales grew 36.5% on top of 80% growth in the first quarter of 2020, which represents a 9% sales penetration this quarter and a two-year comp of 146%.
Pro comps outpaced DIY comps with over 30% comps in the quarter.
In addition to the strength in Pro, we delivered over 60% comps along with significant increase in customer satisfaction in our installation services business.
In the first quarter, I had an opportunity to visit stores in nine of our 15 geographic regions.
I'm also pleased to announce that for the fifth consecutive quarter, 100% of our stores earned a winning together profit-sharing bonus, a record $152 million payout to our frontline hourly associates.
This represents an incremental $70 million above the target level.
We delivered U.S. comparable sales growth of 24.4% in the first quarter.
In fact, 13 of 15 merchandising departments generated comps over 15% and all merchandising departments were up more than 20% on a two-year comp basis.
In addition to lumber, we delivered comps exceeding 30% in electrical, decor, kitchens, and bath, and seasonal and outdoor living.
1 position in outdoor power equipment and truly complements the leading brands we carry such as John Deere, Honda, Husqvarna, Aaron's, and CRAFTSMAN.
As Marvin mentioned, we delivered strong sales growth of 36.5% and a two-year growth of 146% on Lowes.com.
As Marvin mentioned, 100% of our stores earned a "Winning Together" profit-sharing bonus, a record $152 million payout to our frontline hourly associates.
This quarter, we expanded our contact with shopping options by completing the rollout of BOPIS lockers to 100% of our U.S. stores in April.
Having built these lockers in 100% of our U.S. stores will allow us to expand our omnichannel capabilities, further improve customer satisfaction, and limit customer congestion at our service desk.
As Marvin mentioned, Pro outpaced DIY in the quarter with over 30% comps.
As Marvin mentioned, we are seeing terrific momentum in our installation business, with over 60% comps this quarter.
In Q1, we generated $4 billion in free cash flow, driven by improved operational execution and continued strong consumer demand.
We returned $3.5 billion to our shareholders through both a combination of dividends and share repurchases.
During the quarter, we paid $440 million in dividends at $0.60 per share.
We also repurchased 16.8 million shares for $3.1 billion at an average price of approximately $182 a share.
We have approximately $17 billion remaining on our share repurchase authorization.
Capital expenditures totaled $461 million in the quarter as we invest in our strategic initiatives to drive the business and to support our growth.
We ended the quarter with $6.7 billion of cash and cash equivalents on the balance sheet, which includes proceeds from our $2 billion notes offering in March.
In addition, we entered into a $1 billion term loan facility in April, which remains undrawn.
Our balance sheet remains extremely healthy with adjusted debt to EBITDA at 2.07 times at the end of the quarter, well below our long-term target of 2.75 times.
In Q1, we generated diluted earnings per share of $3.21, an increase of 81% compared to adjusted diluted earnings per share last year.
Q1 sales were $24.4 billion, driven by a comparable sales increase of 25.9%.
This was a result of a balanced contribution from both ticket and transactions as comparable average store ticket grew 14.1% and transaction count grew 11.8%, with strong repeat rates from both new and existing customers.
While a little difficult to measure, we estimate that the March government stimulus checks drove 300 basis points of growth, while commodity inflation benefited comps by 460 basis points in the quarter.
U.S. comp sales were up 24.4% in the quarter, consistent with results from the past few quarters.
Our U.S. comps were 24% in February, 35.9% in March, and 13.9% in April.
Looking at U.S. comp growth on a two-year basis from 2019 to '21, February sales increase 30.3%, March increased 48.1%, and April increased 37.1%.
Gross margin was 33.29%, up 19 basis points from last year and up 183 basis points as compared to Q1 of '19.
Product margin rate improved 165 basis points.
However, results pressure gross margin by 15 basis points versus last year.
These benefits to product margin rate were partially offset by 90 basis points of pressure from product mix shifts due to lumber inflation and a less favorable product mix, 20 basis points of pressure from supply chain costs as we continue to invest in our omnichannel capabilities, and 20 basis points of pressure from credit revenue.
SG&A of 18.4% levered 288 basis points, compared to adjusted SG&A in LY, driven primarily by lower COVID-related costs, as well as operating costs leverage resulting from strong sales and our ongoing productivity from our PPI initiative.
As anticipated, we incurred nearly $60 million of COVID-related expenses, as compared to approximately $320 million of COVID-related expenses last year.
The $260 million reduction in these expenses generated 140 basis points of SG&A leverage.
Additionally, strong sales and a focus on efficiency and productivity allowed us to generate leverage of 100 basis points in operating salaries, 35 basis points in occupancy expense, and 5 basis points in advertising.
Now, operating profit was $3.2 billion, an increase of 63% over LY.
Operating margins of 13.3% of sales for the quarter was up 317 basis points to the prior year, driven by both improved operating leverage and improved gross margin rate.
The effective tax rate was 23.5%.
At quarter-end, inventory was $18.4 billion, up $2.2 billion from Q4 levels, in line with seasonal patterns.
This reflects an increase of $4.1 billion from Q1 of 2020 when inventory levels were pressured due to unexpected spikes in demand, as well as COVID-related supply disruptions.
Of note, this includes a year-over-year increase of $780 million related specifically to inflation.
Our year-to-date results are tracking ahead of the robust market scenario that we covered in our December Investor Update.
Those factors build our confidence in our ability to deliver strong results on top of an exceptional year in 2020, including 12% operating margins and flat gross margin rates for the year.
We plan to invest $2 billion in capex this year to drive future growth and returns as we continue our disciplined approach to capital allocation with $9 billion in planned share repurchases this year while also supporting our dividend.

Summary:
Our outstanding performance continued this quarter with total company comparable sales growth of 25.9%.
During the quarter, operating margin expanded 313 basis points on an adjusted basis, leading to diluted earnings per share of $3.21, which is an 81% increase on an adjusted basis over the prior year.
In Q1, we generated diluted earnings per share of $3.21, an increase of 81% compared to adjusted diluted earnings per share last year.
Q1 sales were $24.4 billion, driven by a comparable sales increase of 25.9%.
Our year-to-date results are tracking ahead of the robust market scenario that we covered in our December Investor Update.
We plan to invest $2 billion in capex this year to drive future growth and returns as we continue our disciplined approach to capital allocation with $9 billion in planned share repurchases this year while also supporting our dividend.