Salix Pharmaceuticals Ltd. said Tuesday it turned a profit in the third quarter on rising sales of its drug Xifaxan, used to treat diarrhea and certain neurological problems.

Salix also agreed to buy privately held Oceana Therapeutics for $300 million in cash.

The company reported a profit of $34.3 million, or 55 cents per share. In the third quarter of 2010 it lost $2.7 million, or 5 cents per share. If one-time items are excluded Salix said its profit totaled 77 cents per share. Revenue climbed 81 percent, to $146.2 million from $80.6 million.

Analysts expected the company to report a profit of 63 cents per share on $140.6 million in revenue, according to FactSet.

Sales of Xifaxan rose 48 percent to $96.7 million. The drug has been marketed as a treatment for traveler's diarrhea since 2004, and in March 2010, the Food and Drug Administration approved it as a treatment for overt hepatic encephalopathy, or neurological problems associated with liver failure.

The company raised its annual revenue guidance to $535 million from $520 million. Analysts expect $529.3 million on average.

Salix expects to complete the acquisition of Oceana Therapeutics in December. Oceana has two products on the market. Deflux is a treatment for children with a condition called vesicoureteral reflux, a malformation of the bladder that can cause severe kidney infections and kidney damage. The other drug is Solesta, launched in September. It is a tissue bulking agent used as a treatment for incontinence.

Salix said sales of Deflux totaled about $26 million in the first nine months of 2011.

Shares of Salix rose 98 cents, or 2.9 percent, to close at $34.65 on Tuesday.