Cristiano Ronaldo's second-half treble gave Portugal victory in a dramatic World Cup qualifier which saw three players sent off at Windsor Park.
Bruno Alves volleyed in the opener and Gareth McAuley headed home an equaliser before Portugal striker Helder Postiga was red-carded for a headbutt.
Jamie Ward bundled in to put NI ahead but Chris Brunt was dismissed before Ronaldo made it 3-2 with two headers.
Ronaldo's free-kick sealed the win after Kyle Lafferty was sent off.
Fifa 2014 World Cup Qualifying Group F
The hosts were aiming to build on their surprise win over Russia last month but fell behind on 16 minutes after a cagey opening to the game.
Alves, who headed the game's first chance wide five minutes earlier, made no mistake as he steered his volley beyond keeper Roy Carroll after a corner was cleared to the edge of the area.
Northern Ireland were rattled and Portugal began to look dangerous, though they were made to pay for failing to carve out any clear-cut chances.
The equaliser after 36 minutes was a classic set-piece move - Shane Ferguson provided an inswinging corner and a glancing header from McAuley bouncing before rising high into the net.
Portugal responded with Postiga forcing Carroll into a save with a low shot before Fabio Coentrao fired straight at the home goalkeeper.
But the visitors were reduced to 10 men two minutes before the break when Postiga was shown a straight red for a headbutt on McAuley, who almost netted his second of the night on the restart, with his audacious 35-yard chip sailing just over.
Ward put NI back in front with his first international goal on 52 minutes, turning the ball in from close range after Jonny Evans headed down from a Ferguson corner.
Michael O'Neill's team were in charge but things started to go wrong with Brunt's dismissal, for a second bookable offence after a poor tackle in the 61st minute.
Ronaldo's meagre contribution to the first half was a nutmeg on Steven Davis, but the Real Madrid forward showed his class with a clinical treble.
A near-post header from a 68th-minute corner brought Portugal level and another headed finish, into the corner from a deep cross, made it 3-2.
Substitute Lafferty took the dismissals tally to three, a straight red for a dangerous challenge on Joao Pereira.
And Ronaldo completed his hat-trick seven minutes from time, firing his 20-yard free-kick through the wall and beyond Carroll.
Portugal return to the top of Group F while Northern Ireland, already out of contention, will be without Brunt and Lafferty for Tuesday's qualifier against Luxembourg.
- 01 Carroll Booked
- 02 Hodson
- 04 McAuley
- 05 Evans
- 11 Ferguson (Baird - 76' )
- 07 McGinn (Lafferty - 67' Dismissed )
- 08 S Davis Booked
- 11 Brunt Dismissed after an earlier booking
- 16 Norwood Booked
- 09 Paterson
- 19 Ward (Evans - 71' )
- 12 McGovern
- 23 Devlin
- 06 Baird
- 14 McArdle
- 17 Bruce
- 22 McKeown
- 13 Evans
- 21 O'Connor
- 10 Lafferty
- 15 Grigg
- 18 Magennis
- 20 McKay
- 12 Rui Patricio
- 02 Alves
- 03 Pepe Booked
- 05 Coentrao
- 21 Joao Pereira
- 04 Veloso
- 08 Moutinho
- 16 Meireles (Nani - 55' )
- 07 Ronaldo Booked (Ruben Amorim - 90' )
- 11 Vieirinha (Oliveira - 64' )
- 23 Postiga Dismissed
- 01 Eduardo
- 22 Lopes
- 13 Costa
- 14 Luis Neto
- 19 Antunes
- 06 Andre Martins
- 10 Lica
- 15 Adrien Silva
- 18 Josue
- 20 Ruben Amorim
- 09 Oliveira
- 17 Nani
Live Text Commentary
Full Time The final whistle goes and the game is over.90:00 +4:04
Felipe Joao Moutinho takes a short corner.90:00 +3:41
Filipe Ruben Amorim takes a shot. Roy Carroll turns it away with a diving stop.89:11 Substitution
Substitution Filipe Ruben Amorim comes on in place of Cristiano Ronaldo.88:00
Miguel Nelson Oliveira takes the chance to get an effort at goal and missed to the right of the net.84:52
The referee blows for offside against Martin Paterson. Pedro Rui Patricio takes the free kick.82:23
Assist by Alexandre Fabio Coentrao.82:23 Goal scored
Goal! - Cristiano Ronaldo - N Ireland 2 - 4 Portugal Cristiano Ronaldo finds the net with a shot from the free kick. Northern Ireland 2-4 Portugal.81:31 Booking
Oliver Norwood challenges Alexandre Fabio Coentrao unfairly and gives away a free kick. Oliver Norwood booked.80:00 Dismissal
Free kick awarded for a foul by Kyle Lafferty on Pedro Joao Pereira. Kyle Lafferty is shown a red card for serious foul play. Kleper Pepe restarts play with the free kick.78:27
Miguel Nelson Oliveira gives away a free kick for an unfair challenge on Jonny Evans. Free kick taken by Jonny Evans.76:23
Assist by Alexandre Fabio Coentrao.76:23 Goal scored
Goal! - Cristiano Ronaldo - N Ireland 2 - 3 Portugal Cristiano Ronaldo scores with a header. Northern Ireland 2-3 Portugal.75:47
Corner taken by Felipe Joao Moutinho from the right by-line. Clearance by Jonny Evans.75:47 Substitution
Substitution Chris Baird joins the action as a substitute, replacing Shane Ferguson.74:46
Luis Nani takes a shot. Roy Carroll parries the ball away.70:23 Substitution
Substitution Corry Evans is brought on as a substitute for Jamie Ward.68:59
Miguel Veloso takes a shot. Blocked by Steven Davis.
Assist by Felipe Joao Moutinho.67:25 Goal scored
Goal! - Cristiano Ronaldo - N Ireland 2 - 2 Portugal Cristiano Ronaldo scores with a header. Northern Ireland 2-2 Portugal.67:13
Corner from the right by-line taken by Felipe Joao Moutinho.66:37
Corner taken by Felipe Joao Moutinho from the right by-line. Oliver Norwood makes a clearance.66:13 Substitution
Substitution Kyle Lafferty comes on in place of Niall McGinn.65:29
Miguel Veloso takes a shot. Fine finger tip save by Roy Carroll.64:00 Substitution
Substitution Miguel Nelson Oliveira comes on in place of Adelino Vieirinha.61:59
Booking for Roy Carroll.61:59 Booking
Chris Brunt concedes a free kick for a foul on Pedro Joao Pereira. Chris Brunt is sent off by the referee. Free kick crossed by Felipe Joao Moutinho. Clearance by Gareth McAuley.58:02
Corner taken by Felipe Joao Moutinho from the right by-line. Jonny Evans manages to make a clearance.56:52
Eduardo Bruno Alves is penalised for handball and concedes a free kick. Direct effort from the free kick comes in from Chris Brunt. Pedro Rui Patricio catches the ball.54:32
Short corner worked by Oliver Norwood.54:32 Substitution
Substitution Luis Nani comes on in place of Raul Meireles.51:40
Jonny Evans provided the assist for the goal.51:40 Goal scored
Goal! - Jamie Ward - N Ireland 2 - 1 Portugal Jamie Ward scores with a right foot finish. Northern Ireland 2-1 Portugal.50:58
Corner taken by Shane Ferguson. Jonny Evans takes a shot.50:01
Booking for Alexandre Fabio Coentrao for unsporting behaviour.50:01 Booking
Gareth McAuley takes a shot.47:07
Corner from the right by-line taken by Shane Ferguson. Kleper Pepe manages to make a clearance.45:24
Cristiano Ronaldo challenges Steven Davis unfairly and gives away a free kick. Free kick taken by Gareth McAuley.45:01
The match restarts for the second half.45:00 Half time
Half Time The players leave the pitch at half time.45:00 +0:18
Free kick awarded for a foul by Miguel Veloso on Oliver Norwood. Shane Ferguson crosses the ball in from the free kick. Pedro Rui Patricio punches the ball.44:40
Cristiano Ronaldo challenges Lee Hodson unfairly and gives away a free kick. Niall McGinn restarts play with the free kick.42:51 Booking
Helder Postiga challenges Gareth McAuley unfairly and gives away a free kick. Red card for Helder Postiga. Caution for Cristiano Ronaldo. Free kick taken by Oliver Norwood.41:56
Alexandre Fabio Coentrao takes a shot. Roy Carroll safely holds on.41:27
Helder Postiga takes a shot. Roy Carroll catches the ball.40:43
Helder Postiga takes a shot and missed to the left of the goal.38:48 Booking
Chris Brunt gives away a free kick for an unfair challenge on Cristiano Ronaldo. Chris Brunt booked. Free kick crossed by Felipe Joao Moutinho. Gareth McAuley manages to make a clearance.35:53
Assist by Shane Ferguson.35:53 Goal scored
Goal! - Gareth McAuley - N Ireland 1 - 1 Portugal Gareth McAuley scores a headed goal. Northern Ireland 1-1 Portugal.35:30
Corner taken by Shane Ferguson.34:42
Corner from the left by-line taken by Oliver Norwood. Pedro Rui Patricio punches the ball.31:54 Booking
Steven Davis concedes a free kick for a foul on Adelino Vieirinha. Booking for Steven Davis for unsporting behaviour. Miguel Veloso takes the free kick.29:46
Steven Davis challenges Adelino Vieirinha unfairly and gives away a free kick. Raul Meireles takes the free kick.27:46
Miguel Veloso is penalised for handball and concedes a free kick. Free kick taken by Jonny Evans.25:29
Cristiano Ronaldo takes a shot. Gareth McAuley gets a block in.24:24
Adelino Vieirinha takes a shot. Roy Carroll catches the ball.23:16
Corner from the left by-line taken by Miguel Veloso.22:23
Chris Brunt gives away a free kick for an unfair challenge on Adelino Vieirinha. Felipe Joao Moutinho takes the free kick.20:13
Assist on the goal came from Adelino Vieirinha.20:13 Goal scored
Goal! - Eduardo Bruno Alves - N Ireland 0 - 1 Portugal Eduardo Bruno Alves scores a right footed goal. Northern Ireland 0-1 Portugal.19:30
Corner taken by Felipe Joao Moutinho from the right by-line. Clearance made by Lee Hodson.18:20
Eduardo Bruno Alves fouled by Martin Paterson, the ref awards a free kick. Pedro Rui Patricio restarts play with the free kick.14:48
Cristiano Ronaldo fouled by Oliver Norwood, the ref awards a free kick. The ball is sent over by Raul Meireles. Header by Eduardo Bruno Alves misses to the right of the target.10:44
Free kick awarded for a foul by Miguel Veloso on Gareth McAuley. Free kick crossed by Chris Brunt. Free kick awarded for a foul by Gareth McAuley on Pedro Rui Patricio. Pedro Rui Patricio takes the free kick.9:08
Corner from the left by-line taken by Oliver Norwood.6:38
Kleper Pepe is shown a yellow card for dissent.6:38 Booking
Raul Meireles takes a shot. Blocked by Jonny Evans.3:57
Unfair challenge on Shane Ferguson by Helder Postiga results in a free kick. Roy Carroll restarts play with the free kick.0:00
The game kicks-off.
Live data and text provided by our data suppliers