Brazilian retail chain Hering saw its shares jump by more than 25% on Monday after it announced the sale to local rival Grupo Soma in a BRL5.32 billion ($977 million) deal that came just over a week after it declined an unsolicited offer from Arezzo&Co.

According to the terms of the deal, Grupo Soma will pay BRL9.63 in cash and 1.63 shares for every common share in Hering, equal to a price of BRL32.54 per share, according to a joint statement. Shares in Hering closed at BRL28.62 on Monday, up 26.2% on the day, while shares in Grupo Soma fell 10.1% to BRL12.67.

“Hering and the Grupo Soma believe that the transaction will be transformational in terms of consolidating a brand platform in fashion retail, expanding its total addressable market, connecting different audiences and opening a new space and avenue for growth given the highly complementary portfolio,” the companies said in the statement.

They also said that Hering will pay a break fee of BRL250 million if one side backs out of the deal.

Hering is working with BR Partners as financial adviser and Machado Meyer as legal counsel, while Grupo Soma has G5 Partners and Banco Santander as financial advisers and Mattos Filho as legal adviser.

The announcement of a deal came less than two weeks after Hering’s board of directors unanimously rejected a BRL1.29 billion offer from local footwear company Arezzo.

Arezzo offered to pay BRL1.29 billion in cash and issue 26.8 million in new shares for 21.2% of Hering. Shares in both companies leaped after the news that Hering had rejected the offer on the expectation of further bids. Hering’s stock jumped 28.1% to BRL21.91 and Arezzo’s shares rose 8.35% to BRL80.95.

Grupo Soma, owner of the Farm and Animale retail chains, moved BRL1.82 billion in an IPO in July last year and acquired clothing brand ByNV for BRL210 million in October.