A Trader Joe's cookie has left a bad taste in Pepperidge Farm's mouth.

Pepperidge Farm Inc has sued Trader Joe's, accusing the grocery chain of trademark infringement for selling a cookie that looks too much like its popular Milano cookie.

In a complaint filed on Wednesday in the New Haven, Connecticut federal court, Pepperidge Farm said Trader Joe's is damaging its goodwill and confusing shoppers through its sale of Trader Joe's Crispy Cookies.

RELATED: These bakeries are turning out next-level cookies

Alison Mochizuki, a Trader Joe’s spokeswoman, on Friday said the privately held company does not discuss pending litigation.

Launched in 1956, the Milano consists of chocolate filling, and sometimes other flavors, sandwiched between two oval-shaped cookies. A trademark was registered in 2010.

Pepperidge Farm, a bakery unit of Campbell Soup Co, said Trader Joe's version was more rectangular but had rounded edges, "mimicking an overall oval shape." It also accused Trader Joe's of using similar packaging.

RELATED: Chips Ahoy! releases new cookie flavor

"The acts of Trader Joe's have been malicious and calculated to injure Pepperidge Farm," whose Milano has generated hundreds of millions of dollars of revenue in the last decade, the complaint said.

Pepperidge Farm is seeking a halt to sales of the Trader Joe's cookie, plus compensatory and punitive damages.

"The trust Pepperidge Farm has built with consumers is of utmost importance to us," a spokeswoman said.

Pepperidge Farm is based in Norwalk, Connecticut; Campbell in Camden, New Jersey; and Trader Joe's in Monrovia, California.