Cost of sales for the three months ended June 30, 2019 totaled $16.9 million, an increase of $7.5 million, or 79%, as compared to $9.4 million for the three months ended June 30, 2018. This was primarily due to an increase of $5.8 million in cost of sales from the sale of specialty products and $1.7 million from 503B and API products. Gross margin attributable to product sales increased from 17.7% in the three months ended June 30, 2018 to 23.1% in the three months ended June 30, 2019, primarily as a result of change in product mix.
Research and development expenses for the three months ended June 30, 2019 were $18.5 million as compared to $26.6 million for the three months ended June 30, 2018. This was primarily due to a decrease in licensing fees, as well as expenses in relation to clinical operations and product development. The decrease in these R&D expenses was offset primarily by an increase of $1.1 million of preclinical development costs related to the arginase andTCR-T platforms.
Selling, general and administrative expenses for the three months ended June 30, 2019 were $17.2 million as compared to $12.8 million for the three months ended June 30, 2018. This was primarily due to an increase of $3.7 million related to the costs of preparing to commercialize our proprietary drugs, if approved, and an increase of $1.3 million in general administrative expenses including legal fees and other professional service fees, offset by a decrease of $0.6 million in administrative related compensation expense.
Net loss attributable to Athenex for the three months ended June 30, 2019 was $32.0 million, or $0.44 per diluted share, compared to a net loss of $36.9 million, or $0.58 per diluted share, in the same period last year.
On May 7, 2019, the Company closed a private placement transaction in which it issued 10 million shares of common stock to three institutional investors (Perceptive Advisors, Avoro Capital Advisors (formerly known as venBio Select Advisor) and OrbiMed) at a purchase price of $10.00 per share, for net proceeds of approximately $99.9 million to Athenex.
The Company received a $20 million milestone payment from Almirall S.A. during the second quarter of 2019 in connection with the partnership on tirbanibulin and expects this payment to be recorded as revenue in the second half of 2019.
At June 30, 2019, the Company had cash, cash equivalents, restricted cash and short-term investments of $165.9 million, compared to $107.4 million at December 31, 2018. Based on the current operating plan, we expect that our cash, cash equivalents, restricted cash and short-term investments as of June 30, 2019, together with cash to be generated from our operating activities, will enable us to fund our operations into the third quarter in 2020.
Financial Results for the Six Months Ended June 30, 2019
Product sales reached $47.2 million for the six months ended June 30, 2019, compared with $24.1 million for the six months ended June 30, 2018, an increase of $23.1 million or 96%.
Total revenue for the six months ended June 30, 2019 was $47.5 million, a decrease of $1.9 million, or 4%, as compared to $49.4 million for the six months ended June 30, 2018. The decrease was primarily due to $25.0 million related to license milestone revenue earned in the
3