Marston's is to take over the running of Brains pubs in a bid to save 1,300 jobs in the midst of the coronavirus pandemic.
The pub operator will take over the running of all 156 of the brewer's pubs, mainly in Wales.
Brains said restrictions during the pandemic had put the business under "significant financial pressure".
Chief executive Alistair Darby said the long-term agreement safeguarded 1,300 pub jobs.
Under the agreement, Marston's will pay rent for the entire estate but keep the Brains name while running the pubs as a tenant.
Brains closed more than 100 of its pubs after the Welsh Government announced an alcohol ban in pubs and restaurants at the start of December in a bid curb the spread of the virus.
On Saturday all pubs were forced to close their doors in the final days before Christmas as Wales entered a level four national lockdown.
Last month the 138-year-old firm suggested the previous firebreak lockdown had cost it £1.6m.
The deal, which is expected to close in February, will add to Marston's 1,368 pubs in the UK, including 106 in Wales.
Back in March, Brains announced plans to sell 40 of its pubs with workers warned of potential job losses due to economic uncertainty caused by Brexit.
Ralph Findlay, Chief Executive of Marston's, said the pubs were a "great fit" within the operator's existing estate.
"We look forward to the pub teams joining us and to welcoming guests and the communities which they serve, back into these pubs as the country emerges from the pandemic over the weeks and months ahead," he said.
The Campaign for Real Ale (CAMRA) said the deal brought hope the pubs would survive, but added it would be disappointed if it marked steps towards closing the Cardiff brewery.
"It will be interesting to see what the details of this deal are, how the Marston's beer will sit alongside the Brains beer, and what the future is for the brewery itself," said CEO of CAMRA Tom Stainer.
He added: "This is good news, as we were worried that these pubs would be closed permanently, or sold for property development or non-pub use."
There is currently no suggestion the brewery is affected by the plans.