A top medical device company like Medtronic (MDT 1.37%) would seem like a solid long-term investment. It has been increasing its dividend payment for 45 straight years, so that income will also pad your gains.

But would investing in this business 10 years ago have proven to be a good decision, and a better option than simply investing in the S&P 500? Let's take a look.

Recent losses have wiped out some big gains

Medtronic has a strong international presence, with its medical devices helping people in 150 countries. But that diversification has been hurting the company's operations of late as unfavorable foreign exchange rates have weighed on the business, and COVID lockdowns in China have also hurt sales. The stock is now trading around its 52-week low, and over the past 12 months it has declined by 28%.

Overall, the healthcare stock has still risen significantly from the roughly $47 it was trading at in April 2013. But if the stock were trading near its 52-week high of $114.31, then the return would be around 143% instead of 72%, which is where it is now.

If you had invested $10,000 in the company a decade ago, that would now be worth about $17,300. When also including the dividend, and assuming it was reinvested into the stock, then it would be worth $21,500. While that might seem like a good return, it's a worse than if you had simply invested in the S&P 500:

MDT Total Return Level Chart

MDT total return level data by YCharts.

The returns were nearly identical until late last year, when the bear market pummeled many stocks. And for many years, Medtronic was outperforming the index.

Can Medtronic's stock turn things around?

Medtronic might look like a bad investment based on its 10-year returns, but the sharp decline in value over the past year suggests to me that it could now have the potential be a good buy, especially with China's lockdowns now over. The company also isn't short of growth catalysts, because over the past 12 months, it has obtained roughly 150 product approvals.

What's also promising about this investment is that at 27 times earnings, Medtronic is trading well below its five-year average:

MDT PE Ratio Chart

MDT PE ratio data by YCharts. PE = price to earnings.

Medtronic expects its operations to improve, with organic revenue growth (i.e., not factoring in foreign exchange) for the current quarter between 4.5% and 5%. It's also working on cutting costs to help offset the negative effects of foreign exchange. This suggests that earnings should improve in future quarters, leading to a better earnings multiple and valuation.

Should you buy the stock today?

Medtronic looks like a bit of a contrarian investment today, but as the first chart showed, it was a market-beating stock for many years. The business has struggled due to supply chain issues and foreign exchange, but at its core this remains a solid company to invest in. Over the trailing 12 months, it has accumulated $4.2 billion in free cash flow.

I expect the stock to rally as macroeconomic conditions improve, and adding it to your portfolio before that happens can be an excellent move. And as a bonus, Medtronic pays an attractive dividend yielding of 3.4%.