We generated net sales of $270.4 million during the second quarter of 2021, which represents an increase of 44.2%, compared to $187.5 million during the second quarter of 2020.
More specifically, we posted net sales growth of four -- of 34.6% in our North American fenestration segment, 25.5% in our North American cabinet components segment, and 92.1% in our European fenestration segment, excluding the foreign exchange impact.
In an effort to provide a more realistic comp, on a consolidated basis, we posted revenue growth of 20.6% in the first half of 2021 compared to the first half of 2019 prior to COVID.
We reported net income of $14.6 million, or $0.43 per diluted share, for the three months ended April 30, 2021, compared to $5.5 million, or $0.17 per diluted share, for the three months ended April 30, 2020.
However, this improvement was somewhat offset by a $13 million increase in SG&A during the quarter, $9.7 million of which was related to the valuation of our stock-based comp awards, and $3.1 million of which was due to higher and more normalized medical claims.
On an adjusted basis, EBITDA for the quarter increased by 47.7% to $32.2 million, compared to $21.8 million during the same period of last year.
From a margin standpoint, this increase represents adjusted EBITDA margin expansion of approximately 30 basis points on a consolidated basis.
Cash provided by operating activities was $32.4 million for the three months ended April 30, 2021, compared to $6.1 million for the three months ended April 30, 2020.
Free cash flow came in at $27.8 million for the quarter, compared to essentially zero free cash flow in Q2 of last year.
Year to date, as of April 30, 2021, cash provided by operating activities was $29 million, compared to $2.5 million for the same period of last year.
And free cash flow year to date as of April 30, 2021, was $19.2 million, compared to a negative $12.8 million during the same period of 2020.
Our strong free cash flow generation during the quarter enabled us to repay $25 million in bank debt and repurchased approximately 2 million of our stock.
Our liquidity position continues to improve, and our leverage ratio of net debt to last 12 months adjusted EBITDA improved to 0.3 times as of April 30, 2021.
Based on our strong first-half results and ongoing conversations with our customers, we are raising our expectations for the year again and now expect approximately 20% sales growth in our North American fenestration segment, approximately 15% sales growth in our North American cabinet components segment, and approximately 40% sales growth in our European fenestration segment.
Net sales of $1.04 billion to $1.06 billion.
Adjusted EBITDA of $125 million to $130 million.
Depreciation of approximately $33 million.
Amortization of approximately $14 million.
SG&A of approximately $115 million.
Interest expense of $2.5 million to $3 million.
Tax rate of approximately 27%.
Capex of $30 million to $35 million.
And free cash flow of $60 million to $65 million.
If you adjust for the expected increase in SG&A, the implied incremental adjusted EBITDA margin is in the low 20% range.
From a cadence perspective for Q3 and on a consolidated basis, we expect net sales to be up by 28% to 30% year over year.
We do expect net sales growth of approximately 10% year over year during the quarter on a consolidated basis.
To summarize, on a consolidated basis for the full year, we now expect to generate net sales growth of approximately 23% year over year to the midpoint of guidance while maintaining adjusted EBITDA margin in the low 12% range.
But there is often a contractual lag that can generally be anywhere from 30 to 90 days.
Our North American fenestration segment generated revenue of $146.1 million in Q2, which was approximately 35% higher than prior-year Q2 and compares favorably to Ducker windows shipment growth of 10.8% for the calendar quarter ending March 31, 2021.
Adjusted EBITDA of $20.6 million in the segment was approximately 54.1% higher than prior-year Q2.
For the first six months, this segment had revenue of $274.3 million and adjusted EBITDA of $36.9 million, which represents growth of 25.2% and 67.9%, respectively.
This also represents adjusted EBITDA margin expansion of approximately 340 basis points.
Our European fenestration segment generated revenue of $61.7 million in the second quarter, which is $32.5 million or approximately 111% higher than the prior year.
Excluding foreign exchange impact, this would equate to an increase of approximately 92%.
Adjusted EBITDA of $12.9 million for the quarter was $10 million better than the prior year, but it is important to remember that our U.K. plants were shut down for part of the prior-year comp period.
On a year-to-date basis, revenue of $110.7 million and an adjusted EBITDA of $23.6 million resulted in margin expansion of approximately 840 basis points as compared to the first half of last year.
Our North American cabinet components segment reported net sales of $63.6 million in Q2, which was $12.9 million or approximately 26% better than prior year.
Note that this growth rate was slightly higher when compared to the latest KCMA data for the semi-custom segment which came in at 24.2% growth over the same period.
Adjusted EBITDA was $3 million in this segment, which was 21.6% higher than prior year.
In fact, the rapid increase in hardwood prices has impacted adjusted EBITDA by $1.7 million year to date.
And if we adjust for this inflation, we would have realized approximately 180 basis points of margin expansion in this segment.
On a year-to-date basis, operational improvements and volume-related leverage gains have helped offset the timing-related material impacts and resulted in margin expansion of approximately 150 basis points.
Unallocated corporate and other costs were $4.3 million for the quarter, which is $7.2 million higher than the prior year.
Despite inflationary headwinds, we continue to make progress in these areas and this work has strengthened our balance sheet by enabling us to further pay down debt during the quarter, while still repurchasing approximately $2 million in treasury stock.
With these points in mind, on a consolidated basis, we're confident in our ability to deliver revenue growth in the low-20% range this year, while maintaining adjusted EBITDA margin in the low-12% range despite the increasing inflationary pressures.

Summary:
We generated net sales of $270.4 million during the second quarter of 2021, which represents an increase of 44.2%, compared to $187.5 million during the second quarter of 2020.
We reported net income of $14.6 million, or $0.43 per diluted share, for the three months ended April 30, 2021, compared to $5.5 million, or $0.17 per diluted share, for the three months ended April 30, 2020.
Net sales of $1.04 billion to $1.06 billion.
Adjusted EBITDA of $125 million to $130 million.