Gold eased from record highs on Wednesday as investors took profits, but sentiment remained bullish and a fresh record was within sight as the dollar's weakness and inflation concerns reinforced bullion's appeal as a hedge.

Both spot gold and U.S. gold futures have benefited from factors including technical buying, growing talk of countries diversifying foreign reserves or settlement currencies away from the dollar, and inflation concerns fueled by current massive fiscal stimulus measures and aggressive monetary easing.

The driving force for gold's rally is the declining confidence in the dollar, which helped elevate gold's stature, along with the explosive growth in gold-backed exchange-traded funds which broadened the investor base for bullion, said Shuji Sugata, a manager at Mitsubishi Corp Futures & Securities.

Technically the market is very much in favor of the bulls as nobody can complain about gold prices rising, so barring profit taking that may cap prices for a short time, the market looks set to test fresh highs, he said.

The near-term target is likely $1,050 per ounce, but the $1,040 level offers good profit taking opportunities and may prove to offer resistance that market players need to clear first, he said.

We're seeing a period of consolidation below $1,040 an ounce. Importantly, gold does not appear to be finding support from Tokyo, which is the key region in our time zone, said Nigel Moffatt, head of treasury for the Perth Mint.

Osamu Ikeda, general manager at Tanaka Kikinzoku Kogyo, Japan's biggest bullion retailer, said flows were mixed at this shop this morning.

Both buyers and sellers are coming to the shop today, they are more or less evenly balanced. It's been like that over the past few days as investors stay sidelined to mull over which direction the gold market is taking, he said.

Spot gold was little changed at $1,040.65 per ounce at 0604 GMT, retreating from an all-time peak of $1.043.45 set on Tuesday.

The most active U.S. gold futures for December delivery inched up 0.2 percent to $1,042.0 an ounce, also below an all-time high of $1,045 hit on Tuesday. December contracts settled at $1,039.70 an ounce.

Renowned investor Jim Rogers, one of the biggest bulls on this decade's commodities rally, said he would stay away from buying gold a day after bullion set a new record high, but that he still saw further gains in the long-term.

Investment flows picked up as the market rallied to the record highs.

The world's largest gold-backed exchange-traded fund, the SPDR Gold Trust, said its holdings stood at 1,100.514 tons as of October 6, up 0.2 percent or 2.441 tons from the previous business day for the third consecutive day of increase.

The holdings rose to a record high of 1,134.03 tons on June 1.

There was some profit taking initially, but given the fact that we continue to see further weakening in the U.S. dollar, people might be tempted to hold on and I think it will push higher, said Darren Heathcote of Investec Resources in Sydney.

Gold has gained about 18 percent in the year to date.

The greenback remained pressured on Wednesday after the U.S. currency slid broadly the day before as an interest rate hike in Australia underscored concerns the Federal Reserve will lag other central banks in pulling out of its loose monetary policy.

Also weighing on the U.S. dollar was a British newspaper report that Gulf Arab states were in secret talks with Russia, China, Japan and France to replace the greenback with a basket of currencies in trading oil, though big oil-producing countries denied the report.