Oracle was the worst-performing stock in the S&P 500 on Friday, tumbling more than 6 percent in its worst day in 4 years.

The company reported stronger-than-expected earnings on Thursday for the first quarter of its 2018 fiscal year, which ended on August 31. But the stock turned negative after the company gave guidance for the next quarter.

EPS: Excluding certain items, 62 cents in earnings per share vs. 60 cents in earnings per share as expected by analysts, according to Thomson Reuters.

Excluding certain items, 62 cents in earnings per share vs. 60 cents in earnings per share as expected by analysts, according to Thomson Reuters. Revenue: $9.2 billion vs. $9.02 billion as expected by analysts, according to Thomson Reuters.

In terms of guidance, the company expects to bring in 64 cents to 68 cents in earnings per share and 2 to 4 percent revenue growth — with 39 to 42 percent cloud revenue growth — in constant currency for the second quarter of the 2018 fiscal year. Analysts were expecting 68 cents in earnings per share on $9.49 billion in revenue, according to Thomson Reuters. Immediately after Oracle CEO Safra Catz gave the guidance, the company's stock fell more than 5 percent below the closing price of $52.79 per share.

Immediately after Oracle CEO Safra Catz gave the guidance, the company's stock fell more than 5 percent below the closing price of $52.79 per share.

Revenue for the quarter was up 7 percent from last year. New software license revenue continued to decline; it was down 6 percent for the quarter, although it did surpass the FactSet analyst consensus, according to StreetAccount.

Cloud revenue for the quarter was up 51 percent year over year, according to today's earnings statement. , Oracle executives said they expected cloud revenue to be up 48 to 52 percent year over year for the first quarter of the 2018 fiscal year. Cloud revenue slightly exceeded FactSet's analyst consensus, StreetAccount said.

Cloud has become so important to Oracle that the company has decided to only give top executives their performance options if Oracle "significantly grows its cloud business," according to a regulatory filing from earlier this month. That significant growth would require $20 billion in total cloud revenue, $10 billion in cloud software revenue, and $10 billion in cloud infrastructure and cloud platform revenue in a fiscal year.

Also, the profit margin for cloud software would have to exceed 80 percent. For this quarter, Oracle's cloud software margin came in at 67 percent when certain items are excluded.

In the cloud infrastructure market, Oracle lags behind , and . Oracle competes with a range of companies including Microsoft, , and in cloud software.

Cloud infrastructure and platform revenue came in at $400 million. For the sake of comparison, Amazon's market-leading cloud infrastructure service produced $4.1 billion in revenue of this year.

Historically Oracle has made most of its money by selling software for on-premises data centers. At this point, the company "appears to be over the hump of its transition" to cloud software, Wedbush analysts Steve Koenig and Joseph Winn noted on Wednesday.

The company had $473 million in capital expenditures, which includes the cost of data center infrastructure to support Oracle cloud services. That figure was up 58 percent year over year.

In June Oracle said will use some of its cloud applications.

As it reports earnings, the company is also preparing for its annual OpenWorld conference, which kicks off two and half weeks from now in San Francisco. Oracle board chairman and chief technology officer Larry Ellison said on Thursday's earnings call that the company will unveil service-level agreements that will guarantee cost savings for organizations that switch from Amazon's Redshift database service to Oracle's cloud database.

"There's no one left to buy," Ellison said in response to a question about what to expect from mergers and acquisitions going forward.

Oracle stock is up more than 28 percent since the beginning of the year.

— CNBC's Anita Balakrishnan contributed to this report.