After being stagnant for a few years, Johnson & Johnson stock is turning around thanks to solid growth.

After seeing revenue decline two years in a row, the company posted two years of revenue growth, and first-quarter revenue was up a solid 8.5%.

Investors are convinced this isn't a fluke; Johnson & Johnson stock has risen more than 30% over the last two years.

Over-the-counter products in the U.S. -- which were the bane of the company a few years ago with multiple recalls -- came storming back in the first quarter, up 14% year over year. The affected manufacturing plants are still being upgraded, but other plants have picked up the slack. Three-quarters of the recalled over-the-counter products are scheduled to be on the market by the end of the year .

In the long term, the price of Johnson & Johnson stock will be dictated by the company's pharmaceutical and medical devices divisions, which are considerably larger than its consumer division. Fortunately, both are firing on all cylinders, posting double-digit increases.

Pharmaceutical sales were up 10.4% in the first quarter. Most of that came from the U.S., where sales were up 14.7%. International sales were up just 6.1%, hurt by a stronger dollar; at constant currencies, international pharmaceutical sales rose 8.1%.

The growth came from a mix of older drugs such as Stelara, up 57%, and Invega Sustenna, up 76%, and the strong launch of newer drugs including Incivo, which Johnson & Johnson sells abroad for Vertex Pharmaceuticals(NASDAQ:VRTX). Sales of the U.S. version, called Incivek, continue to decline, but first quarter sales of Incivo -- which Vertex will get a cut of -- increased 17% over the previous quarter.

Xarelto also made a strong showing with sales of $158 million in the first quarter, despite competition from other new blood thinners. We'll have to wait to see how sales of the other new blood thinners -- Bristol-Myers Squibb(NYSE:BMY) and Pfizer's (NYSE:PFE) Eliquis and Boehringer Ingelheim's Pradaxa -- are doing, but my guess is that the strong showing by Xarelto has more to do with the large market. There seems to be room for all three drugs to trounce the current mainstay, warfarin, which doctors hate.

Medical devices and diagnostics were up 10.2% in the fourth quarter thanks in large part to the acquisition of Synthes, which boosted sales of orthopedic products by 59.7%. The acquisition saved the division, where other segments -- mainly diabetes, infection protection, and surgical care -- were in decline.

Where Johnson & Johnson stock goes from here depends a lot on how well it can work through its pipeline of new drugs. The company recently gained FDA approval of a new diabetes drug Invokana, which will likely be a blockbuster, but may take time to get a foothold considering the competition. Still in development, cancer drug ibrutinib looks like a potential winner, as does its hepatitis C drug simeprevir, although that'll need help from some friends to get approved.

Editor's note: A previous version of this article incorrectly referred to Pradaxa as a Factor X inhibitor. The Fool regrets the error.

Fool contributor Brian Orelli has no position in any stocks mentioned. The Motley Fool recommends Johnson & Johnson and Vertex Pharmaceuticals. The Motley Fool owns shares of Johnson & Johnson. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.