Stocks fluctuated in the final minutes of trading Friday before ending mixed after House leaders pulled an unpopular health care bill before a crucial vote. 

The S&P 500 was down 0.08%, the Dow Jones IndustrialAverage fell 0.28%, and the Nasdaq rose 0.19%. 

House leaders pulled the unpopular bill ahead of a vote on Friday afternoon. Republicans could afford only 21 votes against the bill, though they reportedly faced far more than that threshold. 

In a press conference Friday afternoon, House Speaker Paul Ryan said it had been a "disappointing day" but that large change is difficult. Ryan said the Republicans "came up short" in whipping up votes in support of the bill.

The Washington Post's Robert Costa said Donald Trump had confirmed that the bill had been pulled in a phone call minutes before a scheduled vote. Trump reportedly blamed Democrats for the bill's failure. 

A vote on the Obamacare repeal and replace bill was originally scheduled for Thursday evening, but was delayed by GOP leaders. The Trump administration and Ryan have implored lawmakers in closed-door meetings to support the bill.

The passage of the bill was seen by Wall Street as a test as to whether a Trump administration can enact all it has promised, particularly tax cuts and regulatory reform. Patience with the slow progress of health care and financial reforms wore thin earlier in the week, sending stocks spiraling to their worst losses of the year.

"The health care debate isn't about health care," said James "Rev Shark" Deporre in his column for RealMoney, our premium site for investors. "It is about leadership and deal-making. Trump was elected in large part because of his promises that he would work with Congress to enact some significant legislation. Now the market is looking for some confirmation of his abilities. The way he handles this complex issue is a test of his abilities, and that is what the market is trying to evaluate."

The American Health Care Act, designed to replace the Affordable Care Act (better known as Obamacare), has been widely criticized on both sides of the aisle. The Congressional Budget Office calculated that 24 million more people will be uninsured by 2026 under the Republicans' bill, including 14 million more by 2018. Premiums are expected to jump 20% in the individual market in 2018 and 2019.

Trump reportedly had told lawmakers that if the health care bill doesn't pass on Friday, he will move on to tax reform and other issues, leaving Obamacare in place. On the campaign trail last year, Trump said he would repeal Obamacare on day one of his presidency.

Durable goods orders in February came in better than anticipated. The Census Bureau reported on Friday that orders for long-lasting goods in the U.S. rose 1.7% last month, weakening from 2.3% growth in January but above estimates of 1.5% growth. Core goods orders fell by 0.1%, weaker than an anticipated increase of 0.5%. 

The private sector grew at its slowest pace in six months, according to the Markit Flash U.S. PMI. The measure weakened to a reading of 53.4 from 54.2. Analysts anticipated a reading of 54.8. 

The Trump administration officially approved the Keystone XL pipeline on Friday, as expected. Former President Barack Obama had blocked the controversial pipeline. TransCanada (TRP) - Get Report  declined less than 1% after receiving a presidential permit to construct the Keystone pipeline. The permit from the U.S. Department of State led TransCanada to discontinue its bankruptcy claim. The company said it appreciates the new administration "reviewing and approving this important initiative."

Crude oil prices edged higher despite another weekly increase in the number of active oil rigs in the U.S. Baker Hughes data showed active oil rigs climb by 21 to 652 in the past week. Crude has been under pressure on signs of ballooning U.S. supply and increasing production overseas. 

West Texas Intermediate crude was up 0.3% at $47.83 a barrel on Friday. 

Micron Technology (MU) - Get Report  led tech gains on Friday as renewed demand for chips drove earnings growth. Adjusted profit of 90 cents a share came in 7 cents higher than estimates. Sales of $4.65 billion exceeded estimates of $4.64 billion.

RELATED: Jim Cramer on Micron's Blowout Results

The tech sector was the best performer on Friday, giving a big boost to the Nasdaq. Semiconductor stocks, like Micron, up 8%, were rallying with Intel (INTC) - Get Report , Texas Instruments (TXN) - Get Report , Nvidia (NVDA) - Get Report  and Himax Technologies (HIMX) - Get Report each sporting gains. The S&P Semiconductor SPDR ETF (XSD) - Get Report climbed 1%.

Finish Line (FINL) slumped 19% after a disappointing quarter. The shoe retailer swung to a loss of 23 cents a share from profit of 9 cents a share in the year-ago quarter. Adjusted earnings of 50 cents a share came in 20 cents below estimates. Revenue of $557.5 million exceeded estimates of $548.1 million. Same-store sales fell 4.5%. 

RELATED:Jim Cramer: Buy Foot Locker on Any Weakness in Finish Line

GameStop (GME) - Get Report tumbled 13% after reporting a double-digit drop in profit and announcing plans to shutter at least 150 of its total 7,500 stores. The video game retailer reported a 16% decline in fourth-quarter profit and 14% drop in quarterly sales. Net income of $2.04 a share missed estimates of $2.29. 

RELATED: Jim Cramer: Get Out of GameStop

SeaWorld (SEAS) - Get Report added 4% on Friday after announcing that Blackstone Group BX was selling its 21% equity stake for $23 a share, a 33% premium to the Thursday close. A subsidiary of Zhonghong Zhuoye Group, a Chinese company, has agreed to purchase the stake. The sales is expected to close in the second quarter.