LONDON, Dec 28 (Reuters) - Copper prices retreated from the highest in nearly five months on Thursday as investors locked in profits from a rally ahead of year-end.

Aluminium also pulled back after a fresh build-up of inventories, highlighting potential oversupply.

Three-month copper on the London Metal Exchange was down 0.7% at $8,634 per metric ton by 1115 GMT, erasing gains after touching $8,716, its highest since Aug. 1.

"Copper has gone a long way over the past few sessions, so it looks like a bit of profit taking. There are still a few worries about Chinese growth and the property sector," said broker Robert Montefusco at Sucden Financial.

LME copper has gained 10% since hitting an 11-month low of $7,856 on Oct. 23.

The losses were cushioned by a weaker dollar index and gains in equity markets amid optimism about expected U.S. interest rate cuts next year, Montefusco added.

A weaker dollar makes greenback-priced metals cheaper for buyers using other currencies.

"The short-term macro sentiment is bullish, and the low inventory on the spot side will last longer than expected, which will easily support the price," said Huatai Futures in a report.

Copper inventories on the Shanghai Futures Exchange were last at 165,050 tons, the lowest since Sept. 25.

LME aluminium lost 0.9% to $2,366.50 a ton after a rise in LME inventories, which hit six-month highs, having gained 24% over the past two weeks.

Aluminium prices touched an eight-month peak on Wednesday on technical buying and supply concerns.

LME nickel was the biggest decliner on the LME, giving up 1.2% to $16,730 a ton after LME inventories rose to the highest levels since July 2022.

LME zinc slipped 0.2% to $2,636.50 a ton, tin eased 0.2% to $25,590 while lead nudged up 0.1% to $2,087.50.

On a yearly basis, LME nickel was headed for its steepest loss since 2008, down 43.4% so far this year, on oversupply pressure.

For the top stories in metals, click (Reporting by Eric Onstad Additional reporting by Mai Nguyen in Hanoi; Editing by Kirsten Donovan)