Impax Laboratories, with a location in Fort Washington, and Amneal Pharmaceuticals, based in Bridgewater, N.J., announced Tuesday they have agreed to merge in an all-stock deal that would create the nation's fifth-largest generics drug business by revenue.

Impax shareholders will own 25 percent of the new publicly-traded company, and Amneal investors will own 75 percent. The deal is expected to close in the first half of 2018.

The combined company, to be called Amneal Pharmaceuticals, will have more than 300 products filed with the Food and Drug Administration or in development. The companies are merging at a time of tough competitive drug pricing among generic drug makers.

Impax employs 140 in generic product sales, marketing, finance, information technology, and human resources in Fort Washington. At its corporate headquarters in Hayward, Calif., Impax handles research and drug development, manufacturing, and brand sales and market. Impact has about 1,400 employees. The new company, based in Bridgewater, will have nearly 6,500 employees.

Cowen & Co. analysts said the deal was "opportunistic for Impax as it allows the company to combine with a higher quality generics manufacturer, while receiving fair value for its generic pipeline."