The stock rode a slight market upswing, climbing as high as $139.88 before closing at $139.66, up 81 cents for the day. The previous high was $139.19, reached during the dot-com boom on July 13, 1999.

The rise comes after IBM Corp. shares spent much of this year going sideways as concerns about European government debt and a sluggish economic recovery in the U.S. weighed on markets.

Broader factors aside, IBM’s share price reflects steadily climbing profits. Its second-quarter results marked the 30th straight period in which IBM has posted higher earnings per share than the year before. The company’s corporate customers have been opening up their wallets this year to upgrade technology, something many companies decided to put off during the recession to save cash. And IBM has been able to entice still-reluctant businesses with the promise of services and software designed to cut costs by automating or outsourcing complicated jobs.

In recent weeks, IBM’s stock has also enjoyed an updraft from encouraging results at one of its rivals, the Accenture PLC consulting firm. IBM and Accenture battle for contracts to support other companies’ technological infrastructures and advise them on strategy.

Accenture reported at the end of last month that its quarterly earnings jumped 75 percent, and it raised its outlook and dividend payout. Even though the companies compete, IBM benefits when Accenture does well, because investors view it as a sign that corporations are spending more money on services to support their back offices, which lifts both companies’ fortunes. IBM is scheduled to report third-quarter earnings next Monday.

IBM, which is based in Armonk, N.Y., is well-known for policies that are friendly to shareholders. It has established a regular habit of raising its dividend payout, which has tripled on a per-share basis since 2006. And it has committed more than $100 billion to buying back stock since 1995, a move that boosts the value of remaining shares.

On the other hand, the regular buybacks have cut the amount of stock that IBM has outstanding, meaning the company’s overall value hasn’t climbed along with its share price.

At its previous high in 1999, when technology shares were exploding, the company had about 1.8 billion shares outstanding, giving it a total value, or market cap, of about $250 billion. Today, IBM has fewer than 1.3 billion outstanding shares and a total market cap of $176 billion.

That contrasts with some of IBM’s younger competition in the tech sector. Apple Inc., fueled by stellar sales of its iPods, iPhones and MacBooks, rocketed past Microsoft Corp. earlier this year to become the world’s most valuable tech company. Unlike IBM, Apple does not pay a dividend and hasn’t put aside cash for buybacks.