Vical Inc. said Tuesday it turned a profit in the third quarter after licensing a vaccine to Astellas Pharma of Japan.

Vical received a $25 million upfront payment after entering a partnership with Astellas on the drug TransVax. Including that payment, Vical could get up to $130 million in payments related to the vaccine, which is designed to prevent cytomegalovirus reactivation in patients who have received a transplant. It will also receive double-digit royalty payments on sales if the drug is approved.

The company reported a profit of $16.4 million, or 22 cents per share, in the most recent quarter. In the third quarter of 2010, Vical lost $6.8 million, or 12 cents per share. Its revenue grew to $26.6 million from $2.3 million.

Analysts expected Vical to post a profit of 20 cents per share and $25 million in revenue, according to FactSet.

Cytomegalovirus is a common infection, and most people are exposed to the virus at some point in their lives. It generally has no symptoms. However in some infants and people with compromised immune systems, it can cause fever, pneumonia, and other illnesses. Transplant patients take immune system-suppressing drugs, which makes the virus more dangerous to them.

Vical and Astellas plan to test TransVax in a late-stage clinical trial involving patients who have received hematopoietic stem cell transplants, and they are designing a mid-stage trial in solid organ transplant patients. The companies plan to start both studies in the first half of 2012, and Astellas will pay Vical $10 million when the design of the late-stage study is complete. Astellas will be responsible for further development and sales of TransVax. Vical has an option to help promote the drug in the U.S.

Shares of Vical gained 3 cents to $3.02 on Tuesday.