approximately 4.1% of net sales for both the third quarter and first nine months of 2022, and represented approximately 3.8% and 3.9% of net sales for the third quarter and first nine months of 2021, respectively.
Operating income was $681.1, or 20.7% of net sales, and $1,919.7, or 20.5% of net sales, for the third quarter and first nine months of 2022, respectively, compared to $571.2, or 20.3% of net sales, and $1,512.2, or 19.3% of net sales, for the third quarter and first nine months of 2021, respectively. Operating income for both the third quarter and first nine months of 2022 includes $12.0 of acquisition-related expenses (separately presented in the Condensed Consolidated Statements of Income) comprised primarily of external transaction costs as well as the amortization related to the value associated with acquired backlog resulting from an acquisition that closed in 2022. Operating income for the first nine months of 2021 included $55.4 of acquisition-related expenses comprised primarily of transaction, severance, restructuring and certain non-cash costs related to the acquisition of MTS Systems Corporation (“MTS”). For both the three and nine months ended September 30, 2022, the acquisition-related expenses had the effect of decreasing net income from continuing operations by $10.5, or $0.02 per share. For the nine months ended September 30, 2021, the acquisition-related expenses had the effect of decreasing net income from continuing operations by $44.6, or $0.07 per share. Excluding the effect of these acquisition-related expenses, Adjusted Operating Income and Adjusted Operating Margin, as defined in the “Non-GAAP Financial Measures” section below, were $693.1, or 21.0% of net sales, and $1,931.7, or 20.6% of net sales, for the three and nine months ended September 30, 2022, respectively, and $571.2, or 20.3% of net sales, and $1,567.6, or 20.0% of net sales, for the three and nine months ended September 30, 2021, respectively. The increases in Adjusted Operating Income and Adjusted Operating Margin for the third quarter and first nine months of 2022 relative to the comparable periods in 2021 were primarily driven by normal operating leverage on the higher sales volumes, combined with the benefit of ongoing pricing actions, partially offset by the continued impact of the more challenging cost environment.
Operating income for the Harsh Environment Solutions segment for the third quarter and first nine months of 2022 was $207.1, or 26.1% of net sales, and $596.8, or 25.8% of net sales, respectively, compared to $184.7, or 26.1% of net sales, and $524.0, or 25.8% of net sales, for the third quarter and first nine months of 2021, respectively. Operating margin for the Harsh Environment Solutions segment for the third quarter and first nine months of 2022 remained flat relative to the comparable periods in 2021, as normal operating leverage on the higher sales volumes, combined with the benefit of ongoing pricing actions, were offset by the continued impact of the more challenging cost environment.
Operating income for the Communications Solutions segment for the third quarter and first nine months of 2022 was $341.6, or 22.5% of net sales, and $927.2, or 22.0% of net sales, respectively, compared to $276.7, or 21.8% of net sales, and $716.3, or 21.0% of net sales, for the third quarter and first nine months of 2021, respectively. The increases in operating margin for the Communications Solutions segment for the third quarter and first nine months of 2022 relative to the comparable periods in 2021 were primarily driven by normal operating leverage on the higher sales volumes, combined with the benefit of ongoing pricing actions, partially offset by the continued impact of the more challenging cost environment.
Operating income for the Interconnect and Sensor Systems segment for the third quarter and first nine months of 2022 was $185.3, or 18.8% of net sales, and $522.8, or 18.3% of net sales, respectively, compared to $146.5, or 17.4% of net sales, and $432.0, or 18.0% of net sales, for the third quarter and first nine months of 2021, respectively. The increases in operating margin for the Interconnect and Sensor Systems segment for the third quarter and first nine months of 2022 relative to the comparable periods in 2021 were primarily driven by normal operating leverage on the higher sales volumes, combined with the benefit of ongoing pricing actions, partially offset by the continued impact of the more challenging cost environment.
Interest expense for the third quarter and first nine months of 2022 was $32.8 and $91.3, respectively, compared to $29.0 and $86.7 for the third quarter and first nine months of 2021, respectively. The increase in interest expense is driven by the rising interest rate environment and its impact on the balance outstanding under the Company’s U.S. Commercial Paper Program. Refer to Note 4 of the Notes to Condensed Consolidated Financial Statements for further information related to the Company’s debt.
Provision for income taxes for the third quarter and first nine months of 2022 was at an effective tax rate of 23.1% and 23.4%, respectively. Provision for income taxes for the third quarter and first nine months of 2021 was at an