An affiliate of Brookfield Asset Management Inc. agreed to buy Genesee & Wyoming Inc. for about $6.3 billion plus debt, expanding its global portfolio of rail companies with a 120-line network spanning North America, Europe and Australia.

Brookfield will pay $112 a share in cash, a 40% premium from G&W’s close on March 8, the last day of trading before Bloomberg News reported that the railroad operator was exploring a possible sale. The stock rose 8.6% to $108.56 before the start of regular trading Monday in New York.

The deal is valued at $8.4 billion including debt, the companies said in a statement.

Buying G&W will hand a Brookfield consortium, which includes GIC, more than 3,000 customers, alongside a resilient cash flow. The railroad, which also had attracted activist investor Blue Harbour Group LP, doesn’t compete directly with the largest North American railroads, such as Union Pacific Corp., CSX Corp. and Canadian National Railway Co. It has operations in Australia, the U.K. and continental Europe, as well.

“The transaction announced today unlocks the significant shareholder value that GWR’s management team has built over many years, both through acquisitions and operational execution,” Blue Harbour managing director Robb A. LeMasters said in a statement, referring to the railroad’s ticker symbol. Blue Harbor began investing in G&W last year, when the stock traded at about $75 a share, he said.

G&W had climbed 35% this year through Friday, compared with a 17% gain for the Standard and Poor’s Midcap 400 Index. The stock is valued at 23 times estimated earnings, compared with the industry gauge, which is trading at 16.6 times.

“This is a rare opportunity to acquire a large-scale transport infrastructure business in North America,” said Sam Pollock, chief executive of Brookfield Infrastructure. “G&W will be a significant addition to our global rail platform and will expand our presence in this sector to four continents.”

The transaction is expected to close by early 2020.