United States stocks overcame mostly negative early trading to close modestly higher despite a slew of corporate earnings and US economic data failing to provide a clear outlook.
Only the Nasdaq, cheered by upbeat earnings reports by Apple and Facebook, had managed to spend the bulk of the session in positive territory before being joined by the Dow and S&P.
The Dow Jones industrial average closed up 13.37 points, or 0.09%, to 15,555.61 points.
The S&P 500 index rose 4.31 points, or 0.26%, to close at 1,690.25 points.
The Nasdaq Composite closed up 25.59 points, or 0.71%, to 3,605.19 points.
Facebook shares leapt 29.61% after the social network giant reported better-than-expected second quarter earnings and revenue, driven largely by growth in its mobile advertising business.
Dow component 3M overcame early losses to rise 0.19% after the industrial giant reported earnings that matched analyst expectations, though the company's outlook was hampered by falling sales of materials used in electronics and solar energy.
Global conglomerate Unilever reported that profits rise in the first-half of its financial year, but warned of difficult market conditions.
Meanwhile, US economic data showed that initial claims for jobless benefits in the latest week rose slightly more than analysts had predicted, to a seasonally adjusted 343,000.
Separately, data showed that durable goods orders for June rose 4.2% during the month, whereas analysts had forecast a 1.7% rise.