Health-care giant Johnson & Johnson is splitting off its consumer division, following in the footsteps of other big drugmakers that have moved to focus on the more-profitable pharmaceutical market.

The consumer division will be separated in 18 to 24 months, the company said in a statement. The unit has been beset by lawsuits involving products such as baby powder, which has been linked to ovarian cancers in some users.