Canada recorded its largest inflow of foreign direct investment in four years, another sign growing global trade tensions haven’t reduced the appetite for the northern nation’s assets.

Direct investment from abroad rose to $18.7 billion in the second quarter, Statistics Canada reported Thursday from Ottawa. That’s the strongest net inflow of FDI since the beginning of 2015, probably reflecting Newmont Mining Corp.’s mega takeover of Goldcorp Inc. earlier this year.

Yet, even though the large inflow was driven by one major transaction, there’s evidence foreign investment into Canada has been picking for more than a year, since a dismissal performance in 2017 amid an exodus of capital from the nation’s oil patch.

FDI is an important source of capital to Canada because it is a stable source of capital for what have been the economy’s relatively large funding needs over the past decade.

The second quarter actually saw Canada’s economy require less international funding than has been the case recently, due to an improving trade picture.

Canada’s current account deficit narrowed to $6.4 billion, the lowest since 2008, the agency said. That was largely the result of stronger goods exports, driven by a rebound in energy shipments.