The two-way deal, which followed a partnership between the companies in the past year, allows the FamilyMart group to focus on its convenience stores, which have been more profitable than the Uny shops but are facing growing competition from discount drug stores and online businesses.

For Don Quijote, which has defied Japan's weak retail environment with solid sales for around 30 years and is now the country's biggest discounter, the deal offers scale as well as funding.

Dubbed "Donki" and known for selling an eclectic mix of products such as leopard-print rugs and designer handbags, Don Quijote bought a 40 percent stake in Uny last year.

It had begun converting some poorly performing shops into joint big-box shops named "MEGA Don Quijote Uny", and the company said it had succeeded in doubling sales as a result.

That meant the latest move was not totally unexpected, but Dairo Murata, an analyst at JPMorgan Securities Japan, said it had happened sooner than expected.

"The timing of the announcement came a lot quicker than expected by many. It’s a positive surprise,” he said in a report. "In the medium term, converting existing Uny stores to the MEGA Don Quijote format is expected to help boost profits."

Don Quijote will pay 28.2 billion yen ($251.6 million) for the remaining 60 percent stake in Uny, the two companies said in filings with the stock exchange.

FamilyMart Uny will make a tender offer to buy 20.17 percent of Don Quijote for 6,600 yen a share, for a total 211.9 billion yen, they said.

Don Quijote shares jumped over 10 percent to 6,680 yen, while the broader Tokyo market fell nearly 4 percent. The company's shares had risen 5 percent on Wednesday when discussions were first reported by Nikkei Business magazine. FamilyMart Uny fell 5.6 percent following the announcement, after rising 9 percent on Wednesday.

FamilyMart Uny is Japan's second-largest convenience store operator with about 16,700 locations. FamilyMart and Uny, which had owned convenience store chain Circle K Sunkus, merged in 2016 to join forces against Seven-Eleven Japan, owned by Seven & i Holdings.

FamilyMart Uny's business results announced separately on Thursday showed its core operating profit for the six months ended in August rose 19 percent from the same period a year earlier. It credited the tie-up with Don Quijote for helping turn around its general merchandise business.

Don Quijote said it would change its name to Pan Pacific International Holdings Corp.

It also nominated founder Takao Yasuda back to the board. He had stepped down from its board in June 2015, moving to Singapore, and had been pushing for its overseas expansion efforts from there.

Seven & i reported results as well on Thursday. Operating profit for the six months ended Aug 31 rose 2.6 percent to 199.61 billion yen and revenue rose 11.9 percent to 3.34 trillion yen as the company sustained its overseas growth.

With Seven & i approaching 10,000 convenience stores in the United States, the firm is increasingly banking on that country for growth as fears rise that its domestic business is running out of steam.

(Reporting by Taiga Uranaka; Additional reporting by Kaori Kaneko; Writing by Ritsuko Ando; Editing by Stephen Coates and Muralikumar Anantharaman)

By Taiga Uranaka