Warabeya Nichiyo said it had received two separate notices that plum-flavoured rice balls made at a subsidiary's factory and sold at a 7-Eleven convenience store in Saitama, north of Tokyo, contained the pest.

"We sincerely apologise for great inconvenience and discomfort this has caused to our customers," the Tokyo-based company said in a statement on Friday.

Its stock ended down 4.4% after losing as much as 8.6% at one point. The benchmark Nikkei 225 share average closed slightly up on the day.

Warabeya Nichiyo said it has recalled nearly 2,000 rice balls made at the same factory and sold at 373 7-Eleven stores on Thursday and Friday.

The factory's production lines were shut down and sanitised, it said.

Shares of 7-Eleven owner Seven & i Holdings ended roughly flat.

(Reporting by Satoshi Sugiyama; Editing by Chang-Ran Kim and Christopher Cushing)