Shares of International Business Machines (IBM  ) were up Monday on news of a better than expected second quarter by the veteran computing firm. The company reported that it beat Wall Street expectations for earnings and for revenue in several divisions, though reported another successive quarter of decline in overall sales.

IBM, like many major companies, is suffering from immense setbacks amid the coronavirus pandemic.

"It's likely that we see that the economic recovery is looking to be longer and more protracted than we might have hoped for back in March," said CEO Arvind Krishna in an earnings call.

Analysts were aiming low for the computer giant as sales took a hit amid the pandemic, though thankfully for IBM, the actual quarterly results were better than expected.

IBM reported a net income of $1.36 billion for the quarter, generating earnings of $1.52 per share. Adjusted earnings per share were $2.18 For comparison, IBM's net income for the Q2 in 2019 was $2.5 billion with earnings of $2.81. Revenue was down to $18.12 billion from $19.16 billion. The median revenue predicted by analysts was $17.73 billion while adjusted earnings per share was $2.09.

The news was not entirely good, however. IBM sales continued to decline, a trend that has continued for most of the last few dozen quarters. IBM's declining sales were interrupted briefly in Q4 of 2019, with the trend being interrupted at three more times over the last few years, but the decline has largely been unmitigated.

A change in priorities at IBM may be partly to explain for the better than expected quarter. The company has put greater focus on the cloud computing market, the growth of which has been fed by the coronavirus pandemic and the rise of telecommuting in place of traditional office work. The shift seems to have paid off, as IBM's cloud computing division saw a 30% increase in revenue in Q2.

The earnings beat provided IBM with a considerable boost at the market on Monday and into trading on Tuesday. The share price rose somewhat on Monday, going from $126.00 to $126.35 during the day. In aftermarket trading, however, shares leapt 3.6% to $130.92. Progress was all but erased during the day on Tuesday, with shares back down to $120.08 at close, and further down in aftermarket trading.