InterMune Inc. turned a second-quarter profit, reversing a year-ago loss, as the drug developer recorded a gain from the sale of its immune system disorder drug Actimmune and brought in revenue from its lung disease treatment Esbriet.

The Brisbane, Calif., company completed the Actimmune sale last month to specialty drugmaker Vidara Therapeutics International Ltd. for $55 million. InterMune said then the deal would give it additional cash and lower costs as it focuses on Esbriet.

InterMune also recorded $5.5 million in revenue from Esbriet, largely due to sales in Germany.

Esbriet is designed to treat a terminal lung disease called idiopathic pulmonary fibrosis, or IPF, which causes inflammation and scarring of the lung. InterMune began selling Esbriet in Germany last September and now sells it in several European countries. The treatment has not been approved in the United States.

Overall, InterMune earned $493,000, or a penny per share, in the three months that ended June 30. That compares with a loss of $39.9 million, or 68 cents per share, in the previous year's quarter.

All of its revenue came from Esbriet sales.

Analysts expected, on average, earnings of 9 cents per share on $64.6 million in revenue, according to FactSet.

InterMune also said its total cost and expenses climbed 30 percent to $54.1 million, as research and development and selling, general and administrative expenses rose.

The company's shares fell 2.6 percent, or 31 cents, to $11.40 in pre-market trading Monday.