(Reuters) - Auxilium Pharmaceuticals Inc (>> Auxilium Pharmaceuticals, Inc.) agreed to be bought by Endo International Plc (>> Endo International PLC) for $1.67 billion (1.03 billion pounds) and terminated its deal to buy Canadian eye-drug maker QLT Inc (>> QLT Inc.).

Auxilium accepted Endo's offer of $33.25 per share in cash and stock, almost a month after rebuffing a previous offer of $28.10 per share, saying it significantly undervalued the company.

Auxilium shares rose 11 percent in premarket to $33, while Endo shares were down 0.7 percent at $70.50.

Endo, whose men's healthcare products include testosterone replacement therapy Aveed, will now get access to Auxilium's drugs to treat a condition which causes painful erections and a disease that affects the ability to properly use one's fingers.

Endo said on Thursday the deal was valued at $2.6 billion, including the repayment and assumption of debt.

Auxilium will pay QLT a fee of $28.4 million to terminate their $346-million deal, which was partly aimed at cutting Auxilium's tax bill by moving its headquarters to Canada.

Endo moved its tax domicile to Ireland from Pennsylvania last year when it bought Canadian drugmaker Paladin Labs Inc.

Auxilium's drug portfolio include Xiaflex, approved to treat Dupuytren's contracture, a progressive hand disease that affects a person's ability to straighten and properly use their fingers, and Peyronie's disease, a condition that causes curved, painful erections.

Endo said it intends to fund the cash portion of the deal through a combination of cash on hand and committed debt financing from Citi.

Citi is Endo's financial adviser and Sullivan & Cromwell LLP is its legal adviser. Auxilium's financial adviser is Deutsche Bank and Morgan Stanley, while Willkie Farr & Gallagher LLP and Morgan, Lewis & Bockius are its legal advisers.

(Reporting by Ankur Banerjee in Bangalore; Editing by Savio D'Souza)