NEWARK, N.J. — New Jersey’s attorney general on Friday announced a lawsuit against a California company that sells mail-order firearms parts that can be turned into working weapons, the first such action the state has taken since it banned “ghost guns” last year.

The lawsuit alleges that Apple Valley-based U.S. Patriot Armory and owner-founder James Tromblee Jr. violated New Jersey’s consumer fraud laws when it advertised and sold gun parts to an undercover investigator last month.

The company was sent a letter in December asking it to “stop advertising, offering for sale, and/or selling ‘ghost guns’ and ‘ghost gun’ parts to New Jersey residents,” according to the suit. But in February, an investigator for the Attorney General’s Office ordered parts for an AR-15 assault rifle. The shipment was received this month, the suit said.

According to Attorney General Gurbir S. Grewal, 15 other companies that received similar letters have either posted warnings to potential New Jersey buyers on their websites or removed the state from lists of available shipping addresses.

The lawsuit seeks civil penalties and to stop the company from shipping parts to New Jersey.

A message seeking comment from the company was not immediately returned Friday.

Ghost guns are unregistered weapons that don’t have serial numbers. Companies sell the nearly complete weapons, often along with the parts needed to finish them, as well as training so the firearms can be completed.

Gov. Phil Murphy, a Democrat, signed a law last fall that made it a crime punishable by up to five years in prison to buy gun parts for use in making firearms with no serial numbers. It’s also a crime to possess an unregistered assault firearm in New Jersey, punishable by up to 10 years in prison.

“By advertising and selling dangerous and illegal ghost guns to New Jersey residents, failing to disclose the criminal liability buyers are exposing themselves to, and affirmatively misrepresenting that these guns are legal to purchase, this company has shown blatant disregard for New Jersey’s consumer protection laws,” Division of Consumer Affairs acting Director Paul R. Rodriguez said in a statement.

Apple Valley is about 60 miles northeast of Los Angeles.