Retail discounters Dollar General and Dollar Tree will pay $1.2 million in fines for selling expired products, the New York attorney general announced Monday.

The investigation also called out Family Dollar, which was acquired by Dollar Tree in 2015. All the chains sold expired over-the-counter drugs, while Dollar General was fined for selling motor oil unsuitable for modern cars; Dollar Tree also violated New York's bottle deposit law, law enforcement officials said.

Dollar General discontinued the sale of obsolete motor oil during the course of the investigation and has agreed to pay $1.1 million to the state, Attorney General Letitia James said.

"It's a tough pill for New Yorkers to swallow that the over-the-counter drugs they were buying may have been expired," James said in a statement. "New York consumers have a right to expect that products on store shelves are safe, fresh and suitable for their advertised use. These settlements will ensure that Dollar General, Dollar Tree, and Family Dollar will not only pay both a substantial fine and damages, but, more importantly, update their business practices to comply with the law so that no expired over-the-counter drugs are sold to a New York consumer again."

Investigations beginning in March 2016 found that some over-the-counter drugs were months beyond expiration dates, authorities said. They said motor oil not suitable for most engines built after 1930 were also sold at Dollar General stores. Investigators said they were told at Dollar Tree and Family Dollar stores that bottle returns were only accepted with proof of purchase, in violation of a New York law.

"Dollar General is committed to providing its customers with high-quality, reliable products, which includes taking the necessary steps to ensure that products on our shelves are within their respective sell-by dates," the company said in a statement. "We took immediate action to address the situation, and we continue to work with our store teams to ensure that the Company's expectations regarding expired products are clearly communicated, understood and implemented."

"We continue to believe that the DG-branded motor oil products at issue meet both the Company's standards for quality and value, but also all applicable federal and state labeling, marketing and placement requirements where they are sold," Dollar General said.

Dollar Tree, which will pay $100,000, declined to comment.

Dollar General and Dollar Tree will report fiscal second-quarter earnings before the opening bell Thursday. Dollar General is expected to report revenue of $6.89 billion and earnings of $1.57 a share, according to a survey of analysts by Refinitiv. Dollar Tree is estimated to tallied $5.72 billion in revenue on earnings of 81 cents a share.

Dollar General, which is valued at $36 billion, gained 1.6% on Monday. Dollar Tree rose less than a percent, bringing it to a market cap of nearly $23 billion.