Specialty drugmaker Vertex Pharmaceuticals Inc. swung to a fourth-quarter profit after selling the overseas royalty rights of its hepatitis C drug Incivek.

The royalty payout of $152 million from former partner Johnson & Johnson helped Vertex offset lower sales of the drug in the U.S. Domestic Incivek sales plummeted 91 percent to $19.3 million in the last quarter of 2013. J&J markets the drug under the brand Incivo outside the U.S.

Incivek was launched in 2011 as a highly anticipated drug for patients with the liver-destroying hepatitis C virus. After a successful launch it has faced stiff competition from a wave of newer, more effective medications from Gilead Sciences and other companies. Last year Vertex said it would cut 370 jobs, or 15 percent of its workforce, due to competition from rival hepatitis C treatments.

Vertex's total revenue, which also includes the cystic fibrosis drug Kalydeco, edged up to $351.2 million. Kalydeco and Incivek are Vertex's only approved drugs.

The company posted net income of $44.3 million, or 19 cents per share, compared with a net loss of $76.1 million, or 35 cents per share, in the fourth quarter of 2012. Excluding one-time gains, such as the royalty payout, the company would have lost 56 cents per share.

Analysts polled by FactSet expected a loss of 66 cents on revenue of $182.2 million.

For 2014, Vertex expects revenue between $570 million and $600 million. Analysts are looking for sales of $630.6 million.