Mastercard Inc. agreed to buy a payments platform owned by Denmark-based Nets for 2.85 billion euros ($3.19 billion), using its biggest-ever acquisition to help extend a push into faster payments.

With the purchase, Mastercard is getting an electronic-billing platform and clearing and instant-payment services, according to a statement Tuesday. The company said the purchase will hurt profit for as long as two years after it’s completed, which is expected in the first half of 2020.

Companies and governments around the world have been launching real-time payment systems to speed up the movement of money between consumers and businesses, kicking off a race among banks and payment networks to capture those flows.

“Real time is real, it’s here and it keeps growing,” Michael Miebach, Mastercard’s chief product and innovation officer, said in an interview. “What we found in Nets is it’s a business that’s deeply ingrained in some of the most innovative and vibrant payments markets in the world.”

Mastercard’s shares climbed 2% to $261.99 at 8:46 a.m. in early trading in New York. The stock gained 36% this year through Monday, compared with the 22% advance of the 67-company S&P 500 Information Technology Index.

On Monday, the Federal Reserve announced it will build its own real-time gross settlement system for payments in the U.S. after merchants including Inc. and Walmart Inc. said such a move would help improve card payments in the U.S. The Fed’s system will compete directly with one built by the largest U.S. banks through an association called the Clearing House, which used Mastercard technology to build its network.

Mastercard has already spent $1.1 billion this year on acquisitions and strategic equity investments as the firm sought to push into new markets and develop additional forms of electronic payments, Robert Napoli, an analyst at William Blair & Co., said in a note to clients on Monday.

Mastercard plans to expand the Nets businesses beyond their primary markets in the Nordics, Miebach said. The company will continue to look for acquisition opportunities in the real-time payments space, as well as in fraud detection and data analytics, he said.

Earlier this year, Mastercard announced its purchase of Ethoca, which helps merchants identify fraud, and Vyze, a point-of-sale payment provider. The company also acquired Transactis, which helps with bill payments, and Transfast, a cross-border payments network. The company warned last week that expenses will rise more than analysts expected in the third quarter.