Anaheim-based drug maker Questcor Pharmaceuticals Inc. said it signed an agreement to buy BioVectra Inc.

BioVectra, based in Canada, provides contract manufacturing services to companies in the pharmaceutical and biotechnology industries and also manufactures specialty chemicals.

Questcor will pay about $51 million for BioVectra, with another $51 million in potential milestone payments.

The deal is expected to close by the end of the month.

Questcor shares were up about 3% to a market value of $1.6 billion in afternoon trading Thursday, a day after the deal was announced.

The two companies have been working together for almost 10 years on Questcor flagship drug H.P. Acthar Gel, which is used to treat multiple sclerosis flare-ups, infantile-spasm epilepsy and the kidney disorder nephrotic syndrome.

BioVectra, which has about $28 million in annual sales, will continue to operate independently in Prince Edward Island, with its current management team and estimated 180 workers in place.