AT&T (T 0.17%) is back to being a telecom company after the spinoff of Warner Media put an end to its disastrous run as an entertainment conglomerate. While getting out of the media business was the right move for the company, its stock has been punished this year as the economic winds shifted. AT&T was forced to slash its full-year outlook for free cash flow a few months ago as customers started delaying payments.

The poor performance of AT&T stock can partly be attributed to the bridges the company has burned with investors. AT&T transformed from a telecom company into a complicated conglomerate with its spree of media acquisitions, piling debt onto the balance sheet and destroying shareholder value. It's no surprise that investors don't trust the company to make good decisions.

That trust deficit has led to a stock price that looks shockingly cheap given AT&T's position as one of the major wireless providers in the United States. CEO John Stankey recognizes that regaining investor confidence will take time, telling CNBC that a string of solid results will help to entice investors to give the stock another shot. With AT&T's third-quarter results, the company certainly delivered.

Winning subscribers and hiking prices

No matter the state of economy, a smartphone and wireless plan have become essential for most people. Phone upgrade cycles may stretch out, and some customers may trade down to cheaper plans. But AT&T doesn't need to worry about customers dropping their wireless service en masse. Speaking to CNBC following the company's third-quarter report, Stankey noted that customers tend to put a high priority on paying their phone bills.

AT&T is so far feeling little pain related to the state of the economy, other than the payment-timing issues that led to its lower cash flow outlook. The company added 708,000 postpaid phone subscriptions in the third quarter, along with 338,000 fiber subscriptions. Wireless-service revenue jumped 5.6%, while broadband revenue surged 6.1%.

Price increases that AT&T implemented earlier this year certainly didn't drive customers away, and the company saw a shift toward higher-priced unlimited plans. Even as inflation puts stress on household budgets, one area where consumers aren't cutting back so far is wireless service.

AT&T still expects to generate roughly $14 billion of free cash flow this year and expects that number to grow in 2023. Any cash flow left over after paying the dividend will be used to reduce debt.

Still a screaming bargain

Shares of AT&T jumped on Thursday following the strong third-quarter report, so the stock isn't quite as cheap as it was. But this is still a bargain dividend stock that almost certainly won't be this cheap for long.

AT&T's market cap sat right around $120 billion by Thursday afternoon. Based on the company's full-year guidance, the stock trades for just 8.5 times free cash flow -- and remember that free cash flow is depressed this year. Based on the average analyst estimate, AT&T stock trades for just 6.5 times adjusted earnings.

There's a big margin of safety here. Even if things start to go wrong for AT&T as the economy worsens, the valuation is so pessimistic that it almost doesn't matter, as long as your time horizon is measured in years.

Dividends are the main reason why many investors own telecom stocks, and AT&T doesn't disappoint on that front. The stock currently yields about 6.7% following Thursday's rally. Add that dividend to the potential for the stock to earn a less pessimistic valuation and the prospect of free cash flow rising over time, and it's not hard to see how AT&T beats the market over the next five years.

Even at a higher post-earnings price, AT&T is still a bargain stock. It's not too late for investors to jump onboard.