SAO PAULO, May 24 (Reuters) - Banco Inter SA's units soared on Monday after payments company StoneCo Ltd said it would buy a stake of up to 4.99% in the Brazilian online bank and the bank separately announced plans for a Nasdaq listing.

Banco Inter units rose 23% in Sao Paulo, its second-largest daily rise in a year. BTG Pactual analyst Eduardo Rosman said in a note to clients the agreement with Stone "brings a very strong partner" for Inter and its future U.S. listing gives its controlling shareholders more firepower for M&A.

Stone, which is backed by U.S. investors such as Berkshire Hathaway Inc, will have the right of first refusal in case Inter's control changes, and a seat at the digital bank's board. Rosman compared the Inter-Stone agreement with the partnership between Square Inc and CashApp.

Brazilian payments company StoneCo said it planned to spend $471 million on new shares in Banco Inter, which is also backed by SoftBank Group Corp.

The agreement bolsters Inter's competitive profile against large Brazilian banks. Banco Inter intends to list its shares on Nasdaq as Inter Platform. Current shareholders in Brazil will either receive U.S. listed shares or Brazilian Depositary Receipts (BDRs).

It is unclear whether Inter units can remain part of the local index Bovespa, which is usually restricted to locally-listed shares. B3 did not reply to a Reuters request for comment. ($1 = 5.3203 reais) (Reporting by Tatiana Bautzer and Paula Laier, additional reporting by Carolina Mandl, editing by Marguerita Choy and Nick Zieminski)