NEW YORK – Hewlett-Packard made a profit in the latest quarter, reversing a huge loss a year ago that stemmed from an $8 billion charge. But the technology bellwether’s revenue declined amid weakness in the PC market that shows no signs of easing.

Hewlett-Packard Co. said Wednesday that it earned $1.39 billion, or 71 cents per share, in the fiscal third quarter that ended on July 31. That’s up from a loss of $8.86 billion, or $4.49 per share, a year ago when the results included a charge to reflect the shrinking value of Electronic Data Systems, a technology consulting service HP bought for $13 billion in 2008.

Excluding one-time items, HP earned 86 cents per share in the latest quarter, a penny below Wall Street’s expectations.

Total revenue was down 8 percent to $27.2 billion from $29.7 billion.

Analysts expected slightly higher revenue of $27.3 billion, according to FactSet.