Pat Dugan
Executive Vice President Finance and Chief Financial Officer at Westinghouse Air Brake Technologies
Thanks, Rafael, and good morning, everyone. We had solid operational and financial performance during the quarter. As markets continue to gradually recover, we demonstrated our ability to deliver on synergies, to generate strong cash flow and to invest in the future and position Wabtec for profitable growth. Turning to slide six, I'll review the second quarter in more detail.
Sales for the second quarter were $2 billion, which reflects a 16% increase versus the prior year, driven by a broad-based recovery across our portfolio, offset somewhat by lower North America OE Freight markets. For the quarter, operating income was $203 million, and adjusted operating income was $306 million, which was up 17% year-over-year. Adjusted operating income excluded pretax expenses of $103 million, of which $73 million was for noncash amortization and $30 million for restructuring, of which the majority was for our U.K. operations and transaction costs related to the acquisition of Nordco.
Adjusted operating margin was 10 basis points higher than the second quarter last year and up from the first quarter. Versus last year, adjusted operating margin benefited from higher sales and the realization of synergies. Now looking at some of the detailed line items for the second quarter, adjusted SG&A was $254 million, which was 12.6% of sales. This was up from last year due to the normalization of certain expenses compared to the temporary cost actions taken during the depth of the pandemic a year ago.
Adjusted SG&A excludes $9 million of restructuring and transaction expenses. For the full year, we expect adjusted SG&A to be about 12% of sales. We will continue to aggressively manage headcount and structural costs. Engineering expense increased from last year. This was largely due to higher volume outlook for the year. Overall, our investment in technology is still expected to be about 6% to 7% of sales. Amortization expense was $73 million.
For 2021, we expect noncash amortization expense to be about $290 million and depreciation expense of about $205 million. Our adjusted effective tax rate during the quarter was 25.3%, bringing our year-to-date adjusted effective tax rate to be about 26.3%. For the full year, we still expect an effective tax rate of about 26%. In the second quarter, GAAP earnings per diluted share were $0.66, and adjusted earnings per diluted share were $1.06. Now let's take a look at the segment results on slide seven.
Across the Freight segment, total sales increased 11% from last year to $1.3 billion, primarily driven by strong growth in services and aftermarket and higher demand for components. In terms of product lines, Equipment sales were down 2% year-over-year due to fewer locomotive deliveries in North America. In line with improving freight traffic, our services sales improved a solid 22% versus last year, and were up 11% sequentially.
The year-over-year increase was largely driven by strong modernization deliveries, higher aftermarket sales from the unparking of locomotives and the acquisition of Nordco. I'd note the timing of mod deliveries vary from quarter-to-quarter, but we expect our services sales to improve with the gradual recovery in Freight volumes. Digital Electronics sales were down 2% year-over-year as orders shifted to the right in North America due to COVID disruption, yet we had strong momentum with book-to-bill over one for the third quarter in a row.
We continue to see a significant pipeline of opportunities in our digital electronics product line as customers globally focus on safety and improve productivity. Component sales were up 15% year-over-year, driven by demand for railcar components and recovery in industrial end markets. This is compared to a 19% lower railcar build year-over-year. Demonstrating the diversification within our components business, we are encouraged by railcars continuing to come out of storage, higher order rates for new railcars and the broad recovery in industrial end markets.
Freight segment adjusted operating income was $247 million for an adjusted margin of 18.5%. Versus last year, the benefit of synergies and cost actions were offset by sales mix as well as under-absorption due to lower locomotive deliveries. We will continue to execute on our synergy plans and further improve cost to drive margin improvement. Turning to slide eight. Across our Transit segment, sales increased 27% year-over-year to $680 million, driven largely by recovery in OE projects and steady aftermarket sales. OE sales were up 41% year-over-year as the second quarter 2020 was severely impacted by disruptions stemming from the pandemic.
OE sales were also up 12% sequentially, reflecting the continued momentum for investments in green infrastructure. Aftermarket sales were up about 17% from last year. We expect aftermarket sales to improve for the full year as economies continue to open and demand for Transit services increased globally. Adjusted segment operating income was $73 million, which was up 43% year-over-year for an adjusted operating margin of 10.8%, which is slightly down from the first quarter due to a charge for a discrete warranty adjustment of over $5 million.
Across the segment, we continue to drive down cost and improve our project execution. We are committed to drive 100 basis points of margin improvement for the segment in 2021. Now turning to slide nine. We wanted to provide a more detailed look at our 12-month and multiyear backlog. We had another solid performance with total orders for the year exceeding $4 billion resulting in a book-to-bill for the year above one. Orders can be lumpy quarter-to-quarter, but we are encouraged to see a broad-based momentum across the portfolio.
Our Freight segment backlog remained strong at $17.8 billion with year-to-date book-to-bill above 1, driven by broad-based order activity across the portfolio. Our 12-month backlog of $4.1 billion is the highest since the third quarter of 2019, a result of improving end markets. We continue to see a robust pipeline of order opportunities, especially in international end markets. Our Transit segment backlog ended the quarter at $3.7 billion, with a 12-month backlog of $1.7 billion.
We did see some projects push to the right as a result of ongoing disruption due to the pandemic, yet our outlook remained strong as sustainable infrastructure spending increases globally. And finally, at June 30, our multiyear backlog remained strong at $21.5 billion and continues to provide increasing forward visibility. Let's turn to our financial position on slide 10. We had another solid quarter of cash generation. We generated $223 million of operating cash flow during the quarter bringing year-to-date cash flow generated over $0.5 billion.
Our performance clearly demonstrates the quality of our business portfolio. Cash flow was driven largely by good conversion of net income and focused working capital management. During the quarter, total capex was $29 million. In 2021, we expect capex to be about $140 million. During the quarter, we successfully completed a EUR500 million green bond offering and paid down nearly $200 million in debt during the quarter.
As a result, our adjusted net leverage ratio at the end of the second quarter was 2.6 times, and our liquidity is robust at about $1.7 billion. As you can see in these results, our balance sheet remained strong, and we are confident we can continue to drive solid cash generation giving us the liquidity and flexibility to allocate capital towards the highest return opportunities and grow shareholder value.
With that, I will turn the call back over to Rafael.