In May, Punch Taverns halted its plans for The Corn Exchange, in Crickhowell, after protests which led to villagers launching their own bid to buy it.
In a statement, Corn Exchange Action Group said they were thrilled Punch Taverns had agreed the deal.
About 180 people will become joint-owners after it is signed.
The plan is to set up a new company, Corn Exchange Crickhowell Ltd, to try to secure planning permission to turn the building into independent shops with flats above.
The group said enough money has been pledged to cover the agreed price of £300,000 plus VAT, but "more funds will probably be needed to refurbish the building".
Dean Christy, chairman of Corn Exchange Community Investment Group, who has been leading the negotiations with Punch Taverns, said: "This is great news for everyone who wants to ensure the future of our High Street."
Emma Bevan, chair of the action group, said: "We were right to stand up against the plans for a supermarket in our High Street - now we can create something which will make our community proud."
In a statement, Punch Taverns said: "We recognise the strength of feeling in Crickhowell about the town centre and its independent traders and we at Punch are delighted that we have been able to reach an agreement, subject to contract, which satisfies all sides."
A community group has agreed a deal to take over a former Powys pub following concerns it was going to be turned into a well-known supermarket.