(CNBC) The Nasdaq Composite rose slightly on Thursday, lifted by gains in Amazon and Apple, to notch its longest winning streak in nearly a year.

The tech-heavy index gained 0.04 percent to close at 7,891.78 as Amazon rose 0.6 percent to an all-time high while Apple jumped 0.8 percent. The Nasdaq also posted an eight-day winning streak, its longest since October.

Meanwhile, the broader market closed slightly lower as the S&P 500 failed to reach an all-time high. The S&P 500 fell 0.1 percent to 2,853.58 as energy and financials lagged. The Dow Jones Industrial Average slipped 74.52 points to 25,509.23 with Procter & Gamble slipping 1.2 percent.

Note: Read our discussion guidelines before commenting.