Japan's third-biggest convenience store operator FamilyMart Co. has agreed to buy smaller local rival Cocostore Corp. for around ¥13 billion as part of a major industry realignment in the face of a shrinking domestic market, the company announced Tuesday.

The deal will put the newly merged entity on par with the No. 2 competitor Lawson Inc. with about 12,000 shops.

But Lawson is also looking to join hands with others. The company said last week it has started talks on a capital tie-up with Yokohama-based midsize convenience store operator Three F Co.

FamilyMart is also in other merger talks with No. 4 operator, UNY Group Holdings Co., to create Japan's second-largest convenience store operator by sales to better compete with leading Seven-Eleven Japan Co.

Cocostore, a Nagoya-based second-tier player, opened its first store in Kasugai, Aichi Prefecture, in 1971. It is operated by Nagoya-based Morita Enterprise, a company run by the family of Sony Corp. founder Akio Morita.

However, fierce competition made it difficult for the convenience store chain to survive on its own with its relatively small outlet network of 650 stores mostly in the Chubu and Kyushu areas.

The alliance negotiations first surfaced in March after Lawson failed to acquire Cocostore, which terminated a capital and business alliance in August with Ministop Co., a convenience store chain operated by retail giant Aeon Co.

Underperforming Cocostore shops will be converted into FamilyMart stores under the new alliance.