Ronaldo was substituted after Sweden halved the deficit but he was left to watch a victory turn into defeat in front of an adoring crowd of nearly 10,000 as Joao Cancelo agonisingly scored an own goal in the final minute of stoppage-time.