WASHINGTON (Reuters) - Abbott Laboratories has won U.S. antitrust approval to buy Alere Inc on condition that it sell two point-of-care medical testing businesses, the Federal Trade Commission said on Thursday.

Canada also announced on Thursday that it had approved the proposed transaction on similar terms.

Alere’s shares were up 3.5 percent at $50.61 in mid-afternoon trading on Thursday while Abbott was up 3 percent at $53.72.

Abbott first offered to buy Alere in February 2016, but the deal ran into trouble because of issues related to the diagnostic maker’s accounting and sales practices. The company finally agreed to buy Alere in April for about $5.3 billion, down from an initial $5.8 billion offer.

Alere also agreed Thursday to pay more than $13 million to resolve Securities and Exchange Commission charges that it committed accounting fraud and made improper payments to foreign officials.

To win the U.S. antitrust approval, the FTC required Abbott to sell two types of point-of-care medical testing device businesses, which can be used in doctors’ offices, hospitals and homes.

The companies agreed to divest a blood gas testing system that measures the oxygen and carbon dioxide in the blood and a cardiac marker system used to determine quickly if a patient is having a heart attack or congestive heart failure.

Siemens Aktiengesellschaft will buy the blood gas testing business, as well as two Alere facilities in Ottawa. Quidel Corp will buy the heart function testing system business as well as an Alere facility in San Diego.

The deal will help Abbott expand in point-of-care diagnostic testing, a market that is growing as physicians increasingly adopt rapid tests that speed up treatment.

Point-of-care tests provide results to doctors in a matter of minutes and can be conducted in the physician’s office, an ambulance or even at home. Alere makes tests for infections such as HIV, tuberculosis, malaria and dengue.

Last year, Abbott agreed sell its medical optics division to Johnson & Johnson for $4.3 billion, and closed its $25 billion acquisition of St. Jude Medical this January.