IBM reported quarterly earnings that beat expectations on Tuesday, but revenue fell short as the company capped five straight years of declining year-over-year quarterly revenues.

Shares briefly fell more than 3 percent after hours.

  • EPS: $2.38 a share vs. $2.35 a share expected by Thomson Reuters
  • Revenue: $18.16 billion vs. $18.39 billion expected by Thomson Reuters

That’s a 1 percent gain in earnings per share, and a 3 percent decline in revenue from a year ago, the company said.

  • Full-year 2017 EPS guidance: $13.80 per share, vs. $13.78 per share expected by Thomson Reuters

IBM is in the midst of an uneasy transition from its traditional business model to newer bets, like cloud computing and artificial intelligence.

Still, New York–based IBM has seen a 5-year stretch of year-over-year revenue declines since April 2012, when sales were nearly flat from the year-ago period, according to FactSet.

In a statement, IBM chief financial officer Martin Schroeter said the company had ramped up research and development spending during the quarter. R&D spending did edge higher, to $1.53 billion during the quarter, up from $1.46 billion a year ago.

The legacy enterprise technology company, founded over 100 years ago, has reorganized around “strategic imperatives,” which include businesses like cloud, analytics, mobility and security. In 2016, those strategic imperatives grew to represent more than 40 percent of total revenue, CEO Ginni Rometty said earlier this year.

In the first quarter, strategic imperatives revenue grew 12 percent to $7.8 billion, not adjusted for currency, while cloud revenue grew 33 percent to $3.5 billion. Net income was $2.3 billion.

IBM’s cognitive computing technology, Watson, continued to gain ground over the quarter, with new features for marketing. The company also implemented machine learning into pharmaceutical research, and its property, The Weather Company, announced a new collaboration with Samsung and Lyft.

During the quarter, “cognitive solutions” revenue grew more than 2 percent to $4.1 billion, not adjusted for currency, slightly above the $4 billion predicted by StreetAccount. Revenue from business services and consulting fell slightly, in line with StreetAccount estimates, while sales from items like infrastructure, hardware and operating systems fell slightly short of expectations.

Big Blue has also shifted its hiring focus, amid pressure from the new U.S. presidential administration to hire more Americans. Under Rometty, IBM has pledged to hire about 25,000 U.S. workers in the next four years, including 6,000 hires in 2017. Many of those are expected to be “new collar” jobs, or jobs that focus on qualifications like apprenticeships rather than traditional higher education.

At least one big investor has pledged his loyalty to the brand: Berkshire Hathaway’s Warren Buffett, who has praised IBM’s dividends. Buffett paid an average price of $170.43 per share of IBM, as of January. IBM briefly traded above $171 on Tuesday during the regular session, but fell below $164 a share after hours.

IBM said it returned $2.6 billion to shareholders through dividends and share repurchases in the first quarter.