Shares of mobile-payments startup Square Inc. and online-dating service owner Match Group Inc. surged in their first day of trading, a welcome relief for the beaten-down market for initial public offerings.

Both stocks closed above the high end of their estimated IPO ranges on Thursday afternoon, despite disappointing Wednesday night with offerings that priced below or at the low end of expectations.