TPI Composites'Net sales for the three months ended June 30, 2021, increased by $85.0 million or 22.7% to $458.8 million as compared to $373.8 million in the same period in 2020.
Net sales of wind blades increased by $70.6 million or 20.3% to $418.7 million for the three months ended June 30, 2021, as compared to $348.1 million in the same period in 2020. The increase was primarily driven by an 7% increase in the number of wind blades produced during the three months ended June 30, 2021, as compared to the same period in 2020, as a result of increased production at its Mexico, India, Turkey and Iowa facilities. The increase was also due to a higher average sales price due to the mix of wind blade models produced during the three months ended June 30, 2021, as compared to the same period in 2020, and foreign currency fluctuations. Additionally, when comparing its 2021 second quarter net sales against the comparable prior year period, its net sales were negatively impacted by the removal of five contracted manufacturing lines that expired in China at the end of 2020, which was partially offset by the adverse impact that the COVID-19 pandemic had on its net sales in the prior year period. Finally, the net sales increase was partially offset by a decrease in the year over year number of wind blades still in the production process at the end of the period.
Total cost of goods sold for the three months ended June 30, 2021, was $450.5 million and included $4.5 million of costs related to lines in startup and $5.6 million of costs related to lines in transition during the period. This compares to total cost of goods sold for the three months ended June 30, 2020, of $378.6 million and included $6.9 million of costs related to lines in startup and $4.0 million of costs related to lines in transition during the period.
General and administrative expenses for the three months ended June 30, 2021, totaled $6.7 million, or 1.5% of net sales, compared to $6.9 million, or 1.8% of net sales, for the same period in 2020. Net loss for the three months ended June 30, 2021, was $39.8 million as compared to a net loss of $66.1 million in the same period in 2020. Adjusted EBITDA for the three months ended June 30, 2021, increased to $17.4 million as compared to $3.3 million during the same period in 2020.
Adjusted EBITDA margin increased to 3.8% as compared to 0.9% during the same period in 2020. Capital expenditures were $8.3 million for the three months ended June 30, 2021, as compared to $15.0 million during the same period in 2020. Its capital expenditures primarily relate to machinery and equipment at its new facilities and expansion and improvements at our existing facilities.