Gold edged higher on Friday after two-day slump, as energy cost increased and the U.S. dollar gained against other major currencies.

Gold for June delivery ended up 30 cents at $889.70 an ounce on the New York Mercantile Exchange.

On Thursday, the precious metal lost $19.60 an ounce, after dropping more than $16 on Wednesday.

For the week, Gold posted a drop of $25.50 from last Friday's closing level of $912.20 an ounce.

We expect gold to remain vulnerable to further weakness, with a failure to hold above $872 potentially triggering a drop back to $850, said James Moore, an analyst at TheBullionDesk.com, in a research note.

Gold surged 31 percent last year as oil soared 57 percent, spurring the biggest gain in the inflation rate since 1990. Crude-oil prices climbed as much as 3 percent today. Gold dropped 3.9 percent in the past two days, while oil declined 2.8 percent.

Crude prices surged on reports that a ship hired by the U.S. military forces fired shots at two Iranian vessels. Oil rose to $119.55 a barrel, approaching the record of $119.90 set on April 22. Nigeria's Minister of State for Energy Henry Odein Ajumogobia said he expects the country's output of oil to drop by 50 percent, as strike by workers and attacks by rebels have forced its two biggest oil firms, Exxon Mobil and Royal Dutch Shell.

In currency trading, the euro headed for its biggest weekly drop against the dollar in six weeks after reaching a record $1.6019 on April 22. The Fed has lowered borrowing costs 3 percentage points to 2.25 percent in six cuts.

The dollar index, which measures the U.S. currency against a basket of major currencies, gained 0.2 percent to 72.68.

Also on the Nymex, May silver futures gained 19 cents to end at $16.85 an ounce. July platinum futures lost $2.70 to end at $1,968 an ounce, while June palladium rose $2.50 at $448.95 an ounce. May copper futures gained 4 cents to end at $3.92 a pound.