Is the 1st lien holder required to let one payoff after buying a second?

If one bids and wins a second position lien, is the first position lender required to accept your payoff of the first or can they refuse and go to foreclosure?

I have seen “cheap seconds” available where the first mortgage remaining value is low and the property value is high. In this situation the first position lender would get more profit from foreclosing than accepting a payoff. (even after paying overages to the second holder)

So is the first position lender legally required to accept your payoff or can they refuse and go to foreclosure at their discretion?