The euro fell against the dollar on Friday after Spain set a deficit target that defied Europe's new fiscal pact, and oil prices retreated after touching the highest level in 3-1/2 years as fears eased of a supply disruption from Saudi Arabia.

U.S. stocks edged lower, though the S&P 500 and Nasdaq remained on pace for their eighth week of gains in the last nine.

The stronger dollar weighed on gold, which was headed for its worst weekly performance in two months.

The euro was on track for its worst week against the dollar since mid-December after Spain set a softer 2012 deficit target than one agreed under the euro zone's austerity drive.

The euro was last at $1.3201, down 0.9 percent on the day, and on course for a weekly loss of nearly 2 percent.

The new higher self-imposed Spanish debt limit calls into question the basis of the European rescue agreement with Greece and other nations, said Joseph Trevisani, chief market strategist at Worldwide Markets in Woodcliff Lake, New Jersey.

Against the yen, the dollar rose to a nine-month high after Japanese data for January showed that core consumer prices declined for a fourth consecutive month. Markets interpreted the data as suggesting the Bank of Japan will focus on monetary easing, which would weaken the yen.

The yen was last down 0.7 percent at 81.63 to the dollar.

In commodities markets, Brent crude futures fell after surging above $128 a barrel, the highest levels since July 2008, in post-settlement trade on Thursday in reaction to an Iranian media report of a pipeline fire in Saudi Arabia. Prices retreated after CNBC cited a Saudi oil official saying the report was untrue.

London's Brent crude was down nearly 2 percent at $123.97 a barrel. U.S. crude also fell almost 2 percent to $106.86.

Oil prices were being closely watched in the stock market. A steep rise in crude and gasoline prices could cut into consumer spending and damage the economic recovery.

If we have some big event in the Middle East with Iran or what have you, then obviously that could throw a monkey wrench into things in the short run, said Doug Foreman, director of equities at Kayne Anderson Rudnick in Los Angeles California.

On Wall Street, both the Nasdaq and S&P 500 were on track for their third straight weekly advance but gains were limited as economic data throughout the week cast some doubt on the strength of the economic recovery.

The S&P 500 remained within the tight range that has held over the past two weeks, mostly holding gains of nearly 9 percent since the beginning of the year.

We are not racing away any more. We are stuck right at these numbers, said Ken Polcari, managing director of ICAP Equities in New York.

You just have the markets in this holding pattern, biding their time. Everyone is trying to figure out what the answer is going to be.

The Dow Jones industrial average .DJI was down 8.74 points, or 0.07 percent, at 12,971.56. The Standard & Poor's 500 Index .SPX was down 4.34 points, or 0.32 percent, at 1,369.75. The Nasdaq Composite Index .IXIC was down 11.14 points, or 0.37 percent, at 2,977.83.

European stocks finished little changed although the effects of this week's injection of cheap money from the European Central Bank buoyed banking stocks and were expected to continue to underpin the market next week.

By the close, the STOXX Europe 600 banking sector index .SX7P had added 0.6 percent.

The FTSEurofirst 300 .FTEU3 index closed up 0.03 percent at 1,087.08 points, a day after rising 1.1 percent.

Global equities, measured by the MSCI's world equity index .MIWD00000PUS, were down 0.4 percent and on track to close the week flat.

U.S. Treasury debt prices rose after a three-day losing streak, with long-dated government debt supported by scheduled purchases of 30-year bonds by the Federal Reserve as it attempts to stimulate lending and economic growth.

The benchmark 10-year U.S. Treasury note was up 14/32 in price to yield 1.9808 percent.

Gold trimmed early losses but was unable to rebound for a second day after Wednesday's massive selloff. Spot gold was down 0.1 percent versus an early loss of 0.6 percent.

For the week, bullion was headed for a drop of nearly 3.5 percent, largely due to Wednesday's 5 percent plunge -- gold's biggest one-day loss in more than three years.