Ricardo Quaresma struck a dramatic winner late in the second half of extra time as Portugal scraped past Croatia 1-0 in a dour Euro 2016 last-16 encounter in Lens.

Portugal advanced to the knockout stages following an electric 3-3 draw with Hungary in Lyon, but Saturday’s game could not have contrasted more starkly.

Although Marcelo Brozovic and Domagoj Vida had decent opportunities in the second half, the regulation 90 minutes finished without a shot on target for the first time at a major tournament since 1980.

Ivan Perisic rattled the upright in the second additional period, but Portugal struck the decisive blow following a swift break emanating from that near miss.

Nani, who became the fourth player to reach 100 caps for his country, scuffed a shot across the box to Cristiano Ronaldo.

The Portugal captain’s effort was kept out by Croatia goalkeeper Danijel Subasic, but Quaresma was on hand to head home in the 117th minute.

There was one more agonising miss for Croatia as Vida hooked wide, but Portugal survived to set up a quarter-final clash against Poland in Marseille on Thursday.