Gold futures ended with strong gains on Thursday as record energy costs and weakness in the U.S. dollar boosted the demand for a hedge against inflation.

Gold for June delivery rose $10.90 to end at $882.10 an ounce on the New York Mercantile Exchange. The precious metal closed $6.50 lower at $871.20 an ounce, after climbing nearly $27 over the previous three trading sessions.

Crude futures climbed past $124 a barrel in late afternoon electronic trading, and was last up 76 cents at $124.45 a barrel. Gold has trailed advances in oil since setting a record at $1,033.90 an ounce on March 17. The metal has gained 5.3 percent as oil rallied 28 percent this year.

The dollar seems set to provide much of the day's trading direction, while the start of Akshaya Tritiya celebration in India should see physical buying and provide background support, said James Moore, analyst at TheBullionDesk.com.

The dollar fell against the euro and the U.K. pound after the European Central Bank and the Bank of England said it will keep borrowing costs steady to fight inflation.

The ECB, based in Frankfurt, has kept its benchmark refinancing rate steady at 4 percent since June 2007. Meanwhile, the U.S Federal Reserve has lowered the target U.S. bank-lending rate seven times to 2 percent from 5.25 percent in September.

The dollar index, which measures the greenback against a basket of six major currencies, fell 0.2 percent to 73.37.

Also on the Nymex, Silver futures for July delivery rose 17.5 cents, or 1 percent, to $16.87 an ounce. The metal has climbed 13 percent this year.

July platinum rallied $73.30 to end at $2,042.30 an ounce while June palladium futures rose $10.15 to finish at $435.90 an ounce. July copper futures fell 4 cents to end at $3.79 a pound.