(Adds details throughout, updates prices to close)

*

TSX ends up 145.06 points, or 0.75%, at 19,588.83

*

Posts its highest closing level since Dec. 15

*

Materials group adds 1.7%

*

Technology rises 1.5%

TORONTO, Jan 4 (Reuters) - Canada's main stock index on Wednesday rose to its highest closing level in nearly three weeks, helped by gains for gold mining shares and as investors weighed minutes from the U.S. Federal Reserve's latest policy meeting.

The Toronto Stock Exchange's S&P/TSX composite index ended up 145.06 points, or 0.75%, at 19,588.83, its highest closing level since Dec. 15.

U.S. benchmark the S&P 500 also finished higher after minutes from the Fed's December meeting showed officials laser-focused on controlling inflation even as they agreed to slow their interest rate hiking pace.

The Toronto market's materials group, which includes precious and base metals miners and fertilizer companies, added 1.7% as the price of gold climbed to its highest level since June 13.

Technology also gained ground, rising 1.5%, while the heavily-weighted financials group was up 1.3%.

It included a gain of 1.1% for Canadian Imperial Bank of Commerce as the lender said it plans to appeal a New York judge's order to pay $848 million in damages to private equity firm Cerberus Capital Management in a contract dispute tied to the 2008 global financial crisis.

Limiting the TSX's advance for a second straight day was pressure on the energy sector. It ended 1.7% lower as U.S. crude oil futures settled down 5.3% at $72.84 a barrel.

"Oil dropped in a quick heartbeat," said Barry Schwartz, portfolio manager at Baskin Financial Services.

"While that's probably very good long term for the world economy, it's not necessarily good for the Toronto Stock market, which has got a large proportion of oil and gas stocks that were the stalwarts in 2022." (Reporting by Fergal Smith; Additional reporting by Shristi Achar A and Johann M Cherian in Bengaluru; Editing by Josie Kao)