The turnaround came despite a fragile global backdrop