TAIPEI—HTC Corp. posted its first quarterly loss since its public listing in 2002, as an expensive effort to revive its brand through its high-end HTC One smartphone has so far failed to boost sales.

As with former smartphone pace setters Nokia Corp. and BlackBerry Ltd., HTC has struggled to hold its ground against fast-growing Samsung Electronics Co. and low-cost Chinese rivals. The Taiwanese smartphone maker previously warned it was expecting a loss for the third quarter due to high manufacturing and marketing costs for...