By Dan Strumpf 

Stocks turned mixed in afternoon trading, as investors welcomed Scottish voters' decision to remain part of the U.K., while shares of Alibaba Group Holding Ltd. made their trading debut with a sharp gain.

The Dow Jones Industrial Average gained 19 points, or 0.1%, to 17285, earlier hitting an intraday record of 17350.64 in early trading. The S&P 500 index was down a point to 2011 after having reached a record of 2019.27. The Nasdaq Composite Index shed 19 points, or 0.4%, to 4574.

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.2%, while the U.K.'s FTSE 100 index gained 0.3%.

"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.

Meanwhile, Alibaba kicked off trading on the New York Stock Exchange mid-day Friday with a big jump above its $68-a-share offering price. Shares of the Chinese e-commerce company recently traded at $91.24, 34% above the offering price, under the ticker BABA.

Investors around the world have been closely watching the deal, which priced at the top of its recently raised forecast range. The deal itself, open mainly to big asset managers, raised $21.8 billion, making it the biggest-ever U.S.-listed IPO. The figure could rise to $25 billion if underwriters exercise an option to sell more shares.

"From my seat so far it looks like a successful IPO," said Brian Fenske, head of sales trading at brokerage ITG. "It's a unique asset. It's in demand. A lot of investors have been following it for years--it's not a new company."

Ron Weiner, president of RDM Financial Group, which manages about $750 million, said he had been tracking the anticipated pricing of the stock all morning and ultimately decided against buying. However, he said he owns shares in big mutual funds that were able to get shares at the lower offering price.

"I could see it going a lot higher over time, but just decided that we don't want to pay over 90 bucks," he said. He added he expects gains for stocks more broadly this year.

Friday's move extends 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.2% on the week and 8.8% 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 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. fell 3.7%. 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.5% after longtime Chief Executive Larry Ellison said late Thursday he would step down from the technology stalwart.

Rite Aid Corp. shares declined 1.9%, 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