The 11th-hour move from Woolworths sets the scene for a bid war between Australia's two largest retail companies as they look to grow beyond pandemic-related stockpiling while building on their existing coast-to-coast distribution networks.

A month after API signed a A$764 million ($543 million) buyout agreement with Australian Kmart, Target and Officeworks owner Wesfarmers, Woolworths proposed paying 20 cents a share more. API, owner of Priceline and Soul Pattinson pharmacies, said the Woolworths option was better and allowed it to conduct due diligence.

The Woolworths move sent shares of API up as much as 18% on Thursday, trading briefly higher than its A$1.75 offer, as investors braced for a possible counteroffer from Wesfarmers, Australia's ninth-largest company by market value.

"It is a case of looking for areas of growth where they can add value," said Sean Sequeira, chief investment officer at Australian Eagle Asset Management.

"You did see over the last few years that in difficult times healthcare spend has been quite resilient. It's not highly cyclical."

Wesfarmers was not immediately available for comment. The conglomerate, which also owns the Bunnings hardware chain, holds 20% of API which is nearly enough to block a takeover since it needs approval from owners of 75% of the pharmacy chain's shares.

Woolworths said it may opt for a different deal structure - a formal takeover offer rather than a deal that was pre-agreed with API's board, as it was currently suggesting - that would require approval from just 50.1% of the target's shareholders.

Under the already-signed deal with Wesfarmers, a fee of A$7.7 million may be due if either of the parties walked away. API did not specify whether it expected that "break fee" to be payable if it went with Woolworths instead.

Woolworths CEO Brad Banducci said there was a "compelling strategic rationale" behind the move on API, with the benefits to be reinvested into growing the pharmacutical business.

($1 = 1.4069 Australian dollars)

(Reporting by Byron Kaye in Sydney and Sameer Manekar in Bengaluru; Editing by Rashmi Aich and Stephen Coates)

By Byron Kaye and Sameer Manekar