FRANKFURT (Reuters) - Boehringer Ingelheim, Germany's second-largest drugmaker, posted a gain in operating income of 20.7 percent to 3.5 billion euros (3.06 billion pounds) last year, boosted by the purchase of Sanofi veterinary medicine.

Full-year sales increased 13.9 percent to 18.1 billion euros, it said in a statement on Wednesday. That translates to a gain of 4.4 percent when excluding the effects of the Sanofi transaction, which was wrapped up at the beginning of 2017.

The asset swap saw unlisted Boehringer take Sanofi's $13.5 billion animal health subsidiary, making it the world's second-largest player in the industry after Zoetis.

In return, Sanofi obtained the German company's consumer health care business unit, valued at nearly $8 billion, plus $5.5 billion in cash from Boehringer, which Boehringer at the time paid largely from existing liquidity on its balance sheet.

The maker of respiratory medicine Spiriva and the Pradaxa pill against blood clotting said revenues from drugs for humans gained 5 percent to more than 12.6 billion euros.

The group, which has been family controlled since it was founded in 1885, said it was targeting a slight increase in sales this year.

(Reporting by Ludwig Burger)