and a change in estimates, partially offset by a foreign tax rate adjustment resulting in a revaluation of certain deferred tax assets.
Net cash provided by operating activities totaled $417.3 million for the year ended December 31, 2022, compared to $461.9 million for the year ended December 31, 2021. The change was primarily due to a $35.9 million decrease in cash proceeds received from the Company’s stream and royalty interests, net of cost of sales, compared to the prior period.
Net cash used in investing activities totaled $922.9 million for the year ended December 31, 2022, compared to net cash used in investing activities of $417.0 million for the year ended December 31, 2021. The increase over the prior period was primarily due to the Great Bear Royalties Corporation, Rio Tinto Royalty and Idaho Royalty acquisitions.
Net cash provided by financing activities totaled $480.6 million for the year ended December 31, 2022, compared to net cash used in financing activities of $283.2 million for the year ended December 31, 2021. The change was primarily due to an increase in the debt outstanding for the year ended December 31, 2022, that was used to fund acquisitions of new royalty interests at Cortez and the Great Bear project compared to the prior period.
At December 31, 2022, the Company had working capital of $122.2 million, including $118.6 million of cash and equivalents. This compares to working capital of $154.6 million, including $143.6 million of cash and equivalents at December 31, 2021. The decrease in working capital was primarily attributable to the acquisition of royalty and stream interests during the year ended December 31, 2022.
During the year ended December 31, 2022, liquidity needs were met from $417.3 million in net cash provided by operating activities and available cash resources, including $575 million of net borrowing under the revolving credit facility.
Fourth Quarter 2022 Overview
In the fourth quarter, the Company recorded net income and comprehensive income attributable to Royal Gold stockholders of $56.4 million, or $0.86 per basic and diluted share, as compared to net income of $68.2 million, or $1.04 per basic and diluted share, for the quarter ended December 31, 2021. The decrease in net income was primarily attributable to a decrease in revenue, higher interest expense as a result of higher outstanding debt compared to the prior period, and an impairment of a non-principal exploration stage royalty interest in the current period.
During the fourth quarter the Company recognized total revenue of $163.0 million, comprised of stream revenue of $108.9 million and royalty revenue of $54.1 million at an average gold price of $1,726 per ounce, an average silver price of $21.17 per ounce and an average copper price of $3.63 per pound. This is compared to total revenue of $168.5 million for the three months ended December 31, 2021, comprised of stream revenue of $110.6 million and royalty revenue of $57.9 million, at an average gold price of $1,795 per ounce, an average silver price of $23.33 per ounce and an average copper price of $4.40 per pound.
The decrease in total revenue resulted primarily from lower sales at Andacollo, Pueblo Viejo and Peñasquito, partially offset by higher gold and copper sales at Mount Milligan and revenue from the newly-acquired royalties at Cortez.
Cost of sales, which excludes depreciation, depletion and amortization, was $25.0 million for the fourth quarter, in line with $25.1 million for the three months ended December 31, 2021. Cost of sales is specific to our stream agreements and is the result of our purchase of gold, silver and copper for a cash payment. The cash payment for gold from Mount Milligan is the lesser of $435 per ounce or the prevailing market price of gold when purchased, while the cash payment for our other streams is a set contractual percentage of the gold, silver or copper (Mount Milligan) spot price near the date of metal delivery.
General and administrative costs increased to $8.8 million for the fourth quarter, from $8.0 million for the three months ended December 31, 2021. The increase was primarily due to an increase in employee-related costs including non-cash compensation expense.
Depreciation, depletion and amortization was $49.2 million for the fourth quarter, in line with $49.1 million for the three months ended December 31, 2021. The gold and copper depletion rates on the Mount Milligan stream as of September 30, 2022 decreased to $416 per ounce of gold and $1.06 per pound of copper as a result of the increase to proven and probable reserves in the updated Mount Milligan life of mine plan. The decrease was offset by additional depletion from Khoemacau and the recently acquired Rio Tinto and Idaho royalties.
Interest and other expense increased to $6.1 million for the fourth quarter, from $0.9 million for the three months ended December 30, 2021. The increase was primarily attributable to increased interest expense as a result of higher interest rates and an increase in the average amounts outstanding under the revolving credit facility when compared to the prior period.
For the fourth quarter the Company recorded an income tax expense of $12.6 million, compared with income tax expense of $14.0 million for the three months ended December 30, 2021. The income tax expense resulted in an effective tax rate of 18.2% in the current period, compared with 17.0% for the three months ended December 30, 2021.
Net cash provided by operating activities totaled $101.0 million for the fourth quarter, compared to $118.9 million for the prior year period. The decrease was primarily due to a lower contribution from the royalty segment in the current period.