We achieved sales of over $340 million in the quarter, up 38% from the prior year with both divisions having all-time highs.
However, when comparing to a more normalized 2019, we are favorable by 12%.
Our top line sales remained quite strong, up 35% versus last year, but also up 7% over 2019.
Second, we have been aggressively pursuing new business wins with our existing customers, and we are very pleased with our results as our new business awards recover over 1/3 of the lost business on an annualized basis.
And when combined with the return of miles driven and the associated vehicle maintenance, we enjoyed a record-setting quarter for sales, up nearly 50% from last year and up over 25% compared to 2019.
However, similar to Engine Management, here too, we are facing difficult third quarter comparisons to 2020, which was up 25% from '19 and was far and away the biggest third quarter we had ever had in Temperature Control.
All of these elements combined for record profits as we posted earnings per share of $1.26, which is more than 140% greater than 2020 and nearly 40% greater than 2019.
However, looking forward, it is important to point out that the cadence of the last 18 months was very unusual, making the future difficult to predict.
The past 12 months have seen outsized market expansion, which likely includes a certain amount of pent-up demand, and at some point, it will not be a sustainable rate of growth.
We acquired Trombetta, a worldwide leader in mechanical and electronic power switching and power management devices, generating about $60 million in annual sales.
Trombetta is headquartered in Milwaukee, Wisconsin, is run by a strong and seasoned management team and employs approximately 350 associates globally in four locations.
When combined with previous activities, including organic business wins such as our compressed natural gas injection program and other acquisitions, such as the Pollak deal in 2019, we have grown this business to an annual run rate of around $250 million.
Consolidated net sales in Q2 '21 were $342.1 million, up 94.8% versus last year, and our consolidated net sales for the first six months of 2021 were $618.6 million, up $116.4 million or 23.2%.
Engine Management net sales in Q2 were $233.2 million, up $60.1 million versus the same quarter last year.
And for the first six months, were up $71 million to $445.2 million.
These large increases of 34.7% and 19% for the quarter and first six months, respectively, largely reflect the softness we experienced in Q2 last year in the midst of the pandemic.
Given the volatile results in 2020, it's better to compare our results through 2019, where Engine is up 7% for the quarter and up 3.2% for the first six months despite the loss of a large customer.
Additionally, the acquired Trombetta and soot sensor businesses provided approximately $9 million of revenue in the second quarter of 2021.
Temperature Control net sales in Q2 '21 were $106.5 million, up 47.1% versus the second quarter last year and were up 36.4% to $168.9 million for the first six months.
And on that basis, Temp Control sales were up 10.2% for the first six months, with the increases mainly reflecting an earlier-than-usual start to the summer selling season, as Eric alluded to before.
Our consolidated gross margin in Q2 '21 was 29% versus 26% last year, up three points.
And for the first six months, it was 29.6% versus 26.8% last year, up 2.8 points with increases for both the quarter and year-to-date periods coming from both of our segments.
Second quarter gross margin for Engine Management was 28.9%, up 2.2 points from Q2 last year.
And for Temperature Control, was 26.9%, an increase of 4.1 points from 22.8% last year.
For the first six months, Engine Management gross margin was up 2.3 points to 29.8%, while Temp Control was up 3.3 points to 26.4%.
Our consolidated SG&A expenses in Q2 increased by $14 million to $62.3 million, ending at 18.2% of sales versus 19.5% in Q2 last year.
For the first six months, SG&A spending was $116.8 million, up $12.6 million, but ending lower at 18.9% of net sales versus 20.7% last year.
Our consolidated operating income before restructuring, integration and acquisition expenses and other income net in Q2 was $37.7 million or 11% of net sales, up 4.5 points from Q2 last year.
And for the first six months was 10.8% of net sales, up 4.7 points from the first six months last year.
As we note on our GAAP to non-GAAP reconciliation of operating income, our performance resulted in second quarter 2021 diluted earnings per share of $1.26 versus $0.52 last year.
And for the first six months, diluted earnings per share of $2.23 versus $0.95 last year.
Accounts receivable at the end of the quarter were $211.8 million, up $48.8 million from June 2020 and up $13.7 million from December 2020.
Inventory levels finished the quarter at $404.9 million, up $51.6 million from June last year and up $59.4 million from December 2020.
Our cash flow statement reflects cash generated from operations in the first six months of 2021, $23.2 million as compared to cash used of $0.9 million last year.
The $24.1 million improvement was mainly driven by an increase in our operating income.
We used $11.7 million of cash for capital expenditures during the first six months, up from $9 million last year.
We also used $109.3 million to fund our acquisitions of the aforementioned Trombetta and soot sensor businesses.
Financing activities included $11.1 million of dividends paid and another $11.1 million paid for repurchases of our common stock.
Financing activities also included $127.3 million of borrowings on our revolving credit facilities, which were used mainly to fund our acquisitions, but also for investments in capital and returns to shareholders through dividends and share buybacks.
And while after making significant acquisitions in the first six months, we still finished the quarter with total debt of less than 1 times EBITDA given our strong operating performance and ended Q2 with total outstanding borrowings of $137 million and had more than sufficient remaining available capacity under our revolving credit facility of $112 million.

Summary:
Consolidated net sales in Q2 '21 were $342.1 million, up 94.8% versus last year, and our consolidated net sales for the first six months of 2021 were $618.6 million, up $116.4 million or 23.2%.