NEW YORK – Stocks gave up most of their gains to end slightly higher Friday, extending a September rally that slowed as the month wore on.

The Dow Jones industrial tacked on 13 points, while the Standard & Poor’s 500 Index edged up less than a point. Both traded close to the break-even level all day. The Dow and other major indexes logged their third-straight weekly advance.

The market started out on an up note following surprisingly strong profit news late Thursday from technology leaders Oracle Corp. and Research in Motion Ltd., which makes BlackBerrys.

Technology and industrial shares were broadly higher, though energy companies were weak following a drop in crude oil. A decline in a measure of consumer confidence from the University of Michigan/Reuters also kept a lid on buying. Gold set another record, and Treasury prices edged higher in a sign that investors remain cautious.

The Standard & Poor’s 500 Index, the measure used most widely by professional investors, briefly edged above a technical trading threshold, but not enough to convince analysts that the market is ready to move sharply higher. Stocks have been on a nearly unbroken upward march in September, driving the S&P up 7.3 percent.

The Dow Jones industrial average rose 13.02, or 0.1 percent, to close at 10,607.85. The Dow is up 5.9 percent in the month to date, defying skeptics who predicted a decline in September, which is historically a weak one for stocks. It has risen in seven of the past eight days.