* Wall Street ends slightly higher after early profit-taking * Gold also recovers late in the day * Oil slips on worries over demand in China By Leah Schnurr NEW YORK, July 26 (Reuters) - The dollar fell to a five-week low on Friday on expectations the Federal Reserve will underline its intention to keep interest rates low for a long time at its upcoming policy meeting, while U.S. stocks managed to recover late in the day to end with a slim gain. Gold also erased losses late in the session, racking up its third week of gains. But oil, which typically benefits from a weaker dollar, slipped on worries about falling demand in China, the world's second-largest energy consumer. The dollar has tumbled this month as Fed officials have moved to soothe concerns about plans to withdraw stimulus. A Wall Street Journal report published online on Thursday contributed to the greenback's latest fall. It said the Fed, which will begin a two-day policy meeting on Tuesday, may debate tweaking its forward guidance message to hammer home that it will not raise rates any time soon. The dollar was down 0.4 percent against a basket of currencies. The greenback earlier hit 81.548, its lowest since June 20 and just above chart support at 81.506, its 200-day moving average. In addition to the Fed's meeting, the market's tone next week could be determined by a round of U.S. economic indicators, culminating in the government's monthly report on non-farm payrolls on Friday. "Folks are just treading water. They just want to see the big numbers next week to get some directional guidance," said Samarjit Shankar, director of market strategy at BNY Mellon in Boston. The dollar's slide began on July 10, when minutes of the Fed's June meeting gave investors second thoughts about when the U.S. central bank would start reducing stimulus. Last month the Fed said it expects to start slowing the pace of its $85 billion in monthly bond purchases later this year. Chairman Ben Bernanke has since stressed that the timeline is not set in stone and could change if the economic outlook shifts, comments that soothed Wall Street and the bond market. The dollar's weakness pushed the euro to a five-week high of $1.3296. But it erased gains to last trade at $1.3273, slightly lower on the day. U.S. stocks bounced back from early declines to end little changed as investors weighed corporate earnings season and the expected path of monetary policy. Among the major companies to report, shares of Amazon.com were up 2.9 percent and closed at a record. The company reported a second-quarter loss on Thursday but its domestic business expanded quickly. More than a half dozen investment banks raised their share price targets on Amazon on Friday. With the S&P 500 up more than 18 percent for the year, Friday had provided an opportunity for modest profit-taking. "I was surprised we ended up, but people have a sense of optimism about the market," said Matt McCormick, a money manager at Cincinnati-based Bahl & Gaynor Inc. "The bad news from the morning was digested and discarded. Earnings haven't been as bad as people expected and the political issues aren't in the forefront right now. That could change at any moment, but enjoy the summer rally while you can." Still, the S&P was slightly lower for the week, making it the first week in five the benchmark has declined. The index is up 5.3 percent so far this month, putting it on track to be the best month since October 2011. The Nasdaq is up 6.2 percent for July so far, its best monthly gain in a year and half. The Dow Jones industrial average edged up 3.22 points, or 0.02 percent, at 15,558.83. The Standard & Poor's 500 Index added 1.40 points, or 0.08 percent, to 1,691.65. The Nasdaq Composite Index gained 7.98 points, or 0.22 percent, to 3,613.16. The benchmark 10-year U.S. Treasury note was up 4/32, the yield at 2.5643 percent. The pan-regional FTSEurofirst 300 closed down 0.3 percent, its first weekly drop in over a month. World stocks slipped 0.1 percent. Nevertheless, it was a milestone day for Europe, marking one year since ECB President Mario Draghi's "Whatever it takes" speech that turned the tide in the euro zone debt crisis. Italy and Spain have seen their two-year bond yields fall from 5 and 6.4 percent, respectively, before Draghi's speech, to under 2 percent, saving them immense amounts in interest payments. Spot gold cut early losses and was off 0.01 percent on the day at $1,332.86 per ounce as buyers cashed in on the day's $1,340 peak, up around $150 from the three-year low hit on June 28. Brent futures for September dropped 48 cents to $107.17 per barrel after posting a 46-cent gain on Thursday. U.S. light crude for September settled down 79 cents at $104.70 a barrel. Oil prices were dampened by worries over demand from China after China's industry ministry ordered companies across 19 industries to close outdated capacity by the end of September.