related to changes in the mix of products and customers and the impact of manufacturing overhead on the lower level of net revenue in the quarter ended June 30, 2024 compared to the quarter ended June 30, 2023.
Research and Development Expenses. Research and development expenses decreased by 19.0% from $5.2 million in the three months ended June 30, 2023 to $4.2 million in the three months ended June 30, 2024. The decrease in research and development spending was primarily related to decreases of $430,000 of payroll related expenses due to reductions in headcount, $166,000 in outside consulting expenses for the development of our APU-2 product and stock-based compensation expense of $96,000. Research and development expenses in the three months ended June 30, 2024 were also offset by $318,000 of funding received under the government contracts discussed above. Research and development expenses included stock-based compensation expense of $386,000 and $290,000 for the three months ended June 30, 2023 and 2024, respectively.
Selling, General and Administrative Expenses. Selling, general and administrative expenses decreased by 13.3% from $3.0 million in the three months ended June 30, 2023 to $2.6 million in the three months ended June 30, 2024. Selling, general and administrative expenses included a decrease of $86,000 in the value of contingent consideration in the three months ended June 30, 2024 compared to a decrease of $45,000 in the quarter ended June 30, 2023. Selling, general and administrative expenses included decreases of $192,000 in accounting fees, $90,000 in payroll related expenses and $78,000 in outside sales representative commissions. Selling, general and administrative expenses included stock-based compensation expense of $367,000 and $312,000 for the three months ended June 30, 2023 and 2024, respectively.
Gain from Sale and Leaseback Transaction. Gain from sale and leaseback transaction represents the gain from the sale of our headquarters building located at 1213 Elko Drive in Sunnyvale, California. The sale and leaseback transaction was completed on June 6, 2024. For further discussion of the sale and leaseback transaction, see Note - 8 Leases to the Condensed Consolidated Financial statements contained elsewhere in this report.
Interest Income and Other Expense, Net. Interest and other income, net decreased by $25,000 from $80,000 in the three months ended June 30, 2023 to $55,000 in the three months ended June 30, 2024. Interest income decreased by $55,000 from $143,000 in the three months ended June 30, 2023 to $88,000 in the three months ended June 30, 2024 primarily due to lower cash balances invested in money market funds in the quarter ended June 30, 2024 compared to the quarter ended June 30, 2023. Foreign exchange losses were $63,000 for the three months ended June 30, 2023 compared to $33,000 for the three months ended June 30, 2024. The exchange losses in each period were related to our Taiwan branch operations and our operations in Israel.
Provision for Income Taxes. The provision for income taxes increased from $51,000 in the three months ended June 30, 2023 to $57,000 in the three months ended June 30, 2024.
Net Income (Loss). Net loss was $5.1 million in the three months ended June 30, 2023 compared to net income of $1.1 million in the three months ended June 30, 2024. This fluctuation was primarily due to the changes in net revenues, gross profit and operating expenses and the gain from the sale and leaseback transaction discussed above.
Liquidity and Capital Resources
As of June 30, 2024, our principal sources of liquidity were cash and cash equivalents of $21.8 million compared to cash and cash equivalents $14.4 million as of March 31, 2024.
Net cash used in operating activities was $4.3 million for the three months ended June 30, 2024 compared to $3.7 million for the three months ended June 30, 2023. The primary sources of cash in the three months ended June 30, 2024 were net income of $1.1 million and decreases of $419,000 in inventories and $408,000 in accounts receivable. The primary uses of cash in the three months ended June 30, 2024 were a reduction in accrued expenses and other liabilities of $1.2 million and an increase of $278,000 in prepaid expenses and other current assets. The primary reason for the use of cash from operations in the quarter ended June 30, 2024 was an adjustment for the gain on the sale and leaseback transaction that was finalized during the quarter in the amount of $5.7 million.