Shares of telecom giant AT&T (T 1.02%) have greatly underperformed the broader stock market this year. While the S&P 500 has logged a 17% gain year to date, the stock has shed about 20% of its value.

Investors have some legitimate concerns. For one, AT&T's balance sheet is loaded with debt. Net debt totaled $132 billion at the end of the second quarter, approximately unchanged over the prior year. Although the company plans to knock down this debt over the next two years, interest rates have spiked. As it refinances its debt, the company will likely need to accept higher rates.

There's also the issue of lead-coated telecom cables. The Wall Street Journal reported in July that telecom companies including AT&T had left miles of lead-coated cables in the ground, underwater, and on overhead poles.

AT&T has said that it believes lead-coated cables pose no public health risk, but the worst-case scenario would involve telecom companies being on the hook for full-scale mitigation along with potential lawsuits.

While these headwinds shouldn't be ignored, Citigroup analyst Michael Rollins believes that the worst for AT&T stock could be over, and it scored an upgrade from neutral to buy on Monday.

Better wireless conditions

The wireless industry has slowed this year. AT&T is still gaining postpaid phone subscribers, but the pace of those gains has moderated. The company tacked on 326,000 net postpaid phone subscribers in the second quarter, less than half the number it added in the prior-year period.

Despite this slowdown, AT&T still managed to grow its mobility-service revenue by 4.9% year over year in the second quarter. Rollins noted that the company was able to raise prices this year, which is helping to drive revenue growth despite slower subscriber gains.

Most recently, AT&T bumped up prices on legacy wireless plans, which might have helped push subscribers to newer plans. Postpaid-phone average revenue per user was up about 1.5% year over year in the second quarter.

While subscriber gains are tough to come by, smartphone users are holding on to their devices for longer. While upgrading phones is an opportunity for AT&T to snag a customer from a competitor, it's also an opportunity for a competitor to do the same. Consumers sticking with their phones for longer is helping to keep churn at low levels, and Rollins noted that it's reducing the costs associated with device upgrades for the company.

While there are only three major wireless carriers in the United States, cable companies have started to offer their own wireless plans to their TV and internet customers. Here's the catch: Cable companies are leveraging one of the big three networks for their wireless services. Comcast and Charter use Verizon's network, and AT&T recently struck a deal with a collection of hundreds of small cable companies to power wireless services. As Rollins noted, cable companies winning subscribers is not all bad news for the wireless giants.

Rollins also sees the lead cable issue as overblown. While AT&T could be exposed to meaningful financial risks, Rollins believes that the slump in AT&T's stock following the news has more than accounted for those risks.

A chronically cheap stock

AT&T stock is being weighed down by concerns about slower subscriber growth, debt, and the lead cables. But the stock is trading at a historically low valuation, and the dividend yield is at its highest level in more than a decade. In other words, there's a huge margin of safety built in. The dividend appears safe, and Rollins sees improving free cash and debt reductions helping to support it in the years ahead.

Management expects to generate at least $16 billion in free cash flow this year. That puts the price-to-free-cash-flow ratio at about 6.5. The dividend currently yields just shy of 8%, and while dividend growth might be sluggish or nonexistent as the company works to reduce its debt, that sky-high yield plus the chance of stock price appreciation as the valuation becomes less pessimistic makes AT&T stock a compelling investment.