The net sales were $45.7 million or 33.2% of net sales compared to $44.8 million or 32.6% of net sales in the third quarter of 2022. Net product sales in North America was $27.6 million compared to $29.5 million in the third quarter of 2022, primarily due to lower product sales. Net product sales in Brazil rose by 15.7% to $13.3 million due to higher demand. Gross profit increased by 18.7% to $24.8 million in the third quarter of 2023 compared to $20.9 million in the third quarter of 2022. Gross margin was 18% compared to 15.2% in for the same period of 2022, mainly due to a change in product mix and a decrease in unit cost. Selling expenses declined by 5% to $3.8 million from $4 million in the third quarter of 2022. Selling expenses represented 2.8% of net sales in the third quarter of 2023 compared to 2.9% in the third quarter of 2022.
General and administrative expenses, G&A, increased by 24.5% to $6.1 million in the third quarter of 2023 compared to $4.9 million in the same quarter of 2022. The increase was primarily due to higher marketing and office expenses, a onetime expense for the company’s 30th anniversary celebrations and the impact of the appreciation of the U.S. dollar against the RMB. Research and – G&A expenses represented 4.4% of net sales in the third quarter of 2023 compared to 3.6% of net sales in the third quarter of 2022. Research and development expenses, R&D decreased by 27.4% to $6.9 million in the third quarter of 2023 compared to $9.5 million in the third quarter of 2022. R&D expenses represented 5% of net sales in the third quarter of 2023 compared to 6.9% of net sales in the third quarter of 2022.
These expenses were primarily due to higher R&D expenses in the third quarter of 2022 for the development of IRC, ERCB and REPS new products. Income from operations increased by 18.2% year-over-year to $10.2 million compared to $4.9 million in the third quarter of 2022. Higher income from operations was mainly due to increased gross profit and an 8.2% year-over-year reduction in operating expenses in the third quarter of 2023. Other income was $1.2 million in the third quarter of 2023 compared to $0.7 million in the third quarter of 2022, primarily due to more government subsidies received in the third quarter of 2023. Net financial income was $0.2 million in the third quarter of 2023 compared to net financial income of $4.8 million in the third quarter of 2022, mainly due to a decrease in the foreign exchange gain due to foreign exchange volatility.
Income before income taxes and equity and earnings of affiliated companies increased by 12% to $11.2 million in the third quarter of 2023 compared to income before income tax expenses and equity and earnings of affiliated companies of $10 million in the third quarter of 2022. The higher income before income tax expenses and equity in earnings of affiliated companies was mainly due to increased income from operations compared to the third quarter of 2022. Income tax expense was $0.7 million in the third quarter of 2023 compared to an income tax expense of $0.9 million for the third quarter of 2022, which was mainly due to a valuation allowance recognized in the third quarter of 2022. Net income attributable to the prepared company’s common shareholders was $9.5 million in the third quarter of 2023 compared to net income attributable to pair of company’s common shareholders of $7.5 million in the third quarter of 2022.
Diluted income per share increased by 29.2% to $0.31 in the third quarter of 2023 compared to diluted net income per share of $0.24 in the third quarter of 2022. Weighted average under diluted common shares outstanding was 3,189363 [ph] shares in the third quarter of 2023 compared to $3,640,260 in the third quarter of 2022. First 9 months of 2023. Net sales for the first 9 months of 2023 increased by $4.1 million – I’m sorry, by 4.1% to $417.8 million compared to $400.8 million in the first 9 months of 2020. Gross profit for the first 9 months of 2022 increased by 18.3% to $69.1 million compared to $58.4 million in the corresponding period last year. Gross margin for the first 9 months of 2023 was 16.6% compared to 14.6% for the corresponding period in 2022.