BANGOR, Maine — The Queen City’s sandwich battle is over. At least on the legal front it is.

The debate over who makes sandwiches most like the ones served at the Coffee Pot, a landmark Bangor business on State Street that closed its doors on Dec. 31, 2009, quietly rages on.

The closure spun off at least five surrogate sandwiches, including those made by the Coffee Pot Cafe at 652 Broadway, owned by Dr. Robert E. Erickson, a Bangor dentist, and The Legacy Sandwich Shop at 163 State St., owned by Bruce and Carol Guimond of Hermon.

Last year, the Coffee Pot Cafe sued The Legacy Sandwich Shop over the use of the words “deluxe” and “superdeluxe” to describes its sandwiches.

Lawyers for the owners of the two rival Bangor restaurants that make sandwiches similar to the beloved Coffee Pot — a sandwich made with ham or salami, onions, cheese and vegetables — on Oct. 1 filed a joint stipulation of dismissal in U.S. District Court in Bangor. The case will be dismissed by U.S. District Judge D. Brock Hornby “with prejudice,” which means it can not be resubmitted in federal court or refiled in state court.

Earlier this week, Erickson referred questions about the dismissal of the lawsuit to his attorney, Anthony D. Pellegrini of Bangor. Pellegrini declined to comment.

“A dismissal with prejudice functions as an adjudication on the merits and any attempt to refile similar claims in another court, including state court, is barred,” Sean Sweeney, the Portland attorney who represents the Guimonds, said Thursday in an email. “Accordingly, because the Coffee Pot Cafe’s complaint expressly raised issues of state unfair competition in Counts 6-10, the Coffee Pot Cafe is precluded from raising these claims again in state court.”

Carol Guimond said Wednesday that the trademark issue has been hanging over their heads since their second day of business, May 18, 2010, when they received a cease and desist letter from Pellegrini. The lawsuit was filed in March 2012 in federal court in Bangor.

“It feels like a great big cloud has been removed but there’s still damage from the storm,” she said Wednesday in a telephone interview. “It’s been two-and-a-half years of trademark bullying and confusion for our customers.”

She continued: “We are moving forward running our business just as we have but without the lawsuit hanging over us. Our customers have been wonderful and very supportive.”

The complaint alleged that Legacy Sandwich began using nearly identical names — “Legacy Deluxe Sandwich,” “State Street Super Deluxe Ham and Salami Sandwich,” “State Street Super Deluxe Ham Sandwich” and “State Street Super Deluxe Salami Sandwich” — for its own creations when it opened next door to the original Coffee Pot location shortly after the Coffee Pot Cafe made its debut.

The Coffee Pot Cafe alleged that this “caused a likelihood of confusion or of misunderstanding” as to the source of Legacy Sandwich sandwiches and that the similarity of its sandwiches’ names to those used by the Coffee Pot Cafe led some people to believe that there was an affiliation or association.

Sweeney said one of the issues that led to the dismissal of the case was that Erickson filed the trademark for the words “deluxe” and “superdeluxe” with the Maine Secretary of State’s Office, not with the U.S. Patent and Trademark Office, which conducts a search to see if there are other similar patents or trademarks pending. The state is not able to do similar searches to determine the uniqueness of a patent or name, the attorney said.

“A lot of restaurants, including some national chains, use these words,” Sweeney said. “They are common in the food industry.”