By Dan Strumpf 

Major stock benchmarks shot to fresh records Friday as investors cheered Scottish voters' decision to remain part of the U.K., while market watchers looked ahead to public trading of Alibaba Group Holding Ltd.

The Dow Jones Industrial Average gained 50 points, or 0.3%, to 17316 points, earlier hitting an intraday record of 17350.64 in early trading. The S&P 500 index rose four points, or 0.2%, to 2015 after having reached a record of 2019.27. The Nasdaq Composite Index advanced five points, or 0.1%, to 4599.

Investors widely embraced Thursday's vote in Scotland that rejected independence from the U.K., snapping up shares of European companies and pushing the British pound to a two-week high against the dollar and a two-year high against the euro.

The Stoxx Europe 600 index climbed 0.3% recently, while the U.K.'s FTSE 100 index gained 0.4%.

"Uncertainty is never good for the market, and now you've removed a layer of uncertainty, so everyone is embracing that," said Michael Antonelli, sales trader at brokerage Robert W. Baird. "The market would have gotten smoked if they had voted 'yes'."

While the vote heads off thorny economic and political questions over the fate of the U.K., growing confidence in a vote against independence had already boosted markets earlier this week, before the referendum result was known.

"What we're seeing this year is almost every geopolitical risk or news story at best creates short-term volatility," said Doug Cote, chief market strategist at Voya Investment Management.

Meanwhile, investors were also looking ahead to public trading in Alibaba after the e-commerce company priced late Thursday at $68 a share. The company is expected to emerge with an early market value of $168 billion, making it one of the 40 largest companies globally.

Recent indications were that the stock would open between $90 and $91 a share, significantly above the Thursday night price. Shares are set to begin trading later Friday on the New York Stock Exchange under the ticker symbol BABA.

Friday's gains extend a strong week for stocks, as investors were encouraged by the Federal Reserve's latest policy statement on Wednesday that signaled plans to keep interest rates low for a long time. The S&P 500 is up 1.6% on the week and 9.2% this year. The economic calendar was light Friday.

Trading in stocks broadly has been guarded, with investors wary of pushing stocks sharply higher and setting cautious limits on their trades, said Tom Carter, managing director at brokerage JonesTrading. Still, investors seem comfortable with higher stock prices.

"Nothing's spooked the market this yet--all the big stuff this week, and nothing's spooked it," Mr. Carter said. "You've been hearing for a while, 'OK, this is the top, we're due, this is the right time of year for us to move a little lower.' And it's not."

Shares of Yahoo Inc. gained 0.3%. The company is one of Alibaba's biggest stakeholders and is set to earn about $5.1 billion on the IPO as one of the biggest sellers of shares.

Shares of Oracle Corp. fell 4.3% after longtime Chief Executive Larry Allison said late Thursday he would step down from the technology stalwart.

Rite Aid Corp. shares declined 3.7%, extending a slump after Thursday's loss of 18.5%, after the company reduced its full-year earnings guidance based on expectations for lower pharmacy margins in the second half.

In commodity markets, crude-oil futures fell 1.2% to $91.96 a barrel. Gold futures declined 0.6% to $1228.30 an ounce. The yield on the 10-year Treasury note eased to 2.616% from 2.629% late Thursday.

Josie Cox and Matt Jarzemsky contributed to this article.

Write to Dan Strumpf at daniel.strumpf@wsj.com

Alibaba (NYSE:BABA)
Historical Stock Chart
From Mar 2024 to Apr 2024 Click Here for more Alibaba Charts.
Alibaba (NYSE:BABA)
Historical Stock Chart
From Apr 2023 to Apr 2024 Click Here for more Alibaba Charts.