Everton toiled before finally overcoming an under-strength Swansea City to secure a place in the FA Cup quarter-finals.
Lacina Traore - on loan at Everton from Monaco - looked to have paved the way to a comfortable passage when he scored with a backheel only four minutes into his debut.
But Swansea, with caretaker manager Garry Monk making eight changes from the team that drew at Stoke in midweek, showed commendable resolve and were quickly level through Jonathan de Guzman's header.
The hosts were creating the better chances but the game was transformed when manager Roberto Martinez sent on Scotland striker Steven Naismith for the tiring Traore on the hour.
FA Cup quarter-final draw
- Arsenal v Everton
- Brighton & Hove Albion or Hull City v Sunderland
- Sheffield United v Sheffield Wednesday or Charlton Athletic
- Manchester City v Wigan Athletic
Ties to be played 8-9 March
He took advantage of Neil Taylor's poor backpass to put Everton ahead five minutes after his introduction then was fouled by Ashley Richards in the area, allowing Leighton Baines to confirm the win.
It keeps Martinez
on course to retain the trophy
he won with Wigan last season but he will know Everton cannot afford some of the defensive carelessness they showed before finally making their superiority count.
Particularly as they face Arsenal next after the Premier League title hopefuls
beat Liverpool 2-1
at Emirates Stadium in their fifth-round tie.
The Swans' teamsheet may have had an unfamiliar appearance but they started with real ambition and should have taken the lead in the opening moments when Pablo Hernandez played in Alvaro Vazquez - but he took the ball too wide, and when Roland Lamah finally got a shot in Everton keeper Joel Robles was able to save.
It looked an expensive miss as Traore marked his debut with a goal, cleverly backheeling past Gerhard Tremmel after Sylvain Distin showed composure in the area to set up the giant striker.
The Toffees, however, were looking alarmingly slack in defence and it was hardly a surprise when the visitors equalised after 15 minutes, De Guzman timing his arrival perfectly to head Taylor's cross beyond the reach of the diving Robles.
Baines is spot on
Leighton Baines's converted spot-kick was his first goal at Goodison Park since February 2013.
Swansea were acquitting themselves well but Everton were creating the better chances, Pienaar coming closest when he directed Baines's cross on to the woodwork, with Traore unable to head the rebound beyond Tremmel.
The visitors were forced to replace Kyle Bartley with the experienced Ashley Williams before half-time when he suffered a hamstring injury.
Everton had another opportunity before the break when Tremmel turned away a Kevin Mirallas free-kick but Swansea could be well satisfied with their first half's work.
Monk made a change at the break, sending on Nathan Dyer for Wayne Routledge but Martinez waited until the hour before making a double change, as Naismith and Leon Osman replaced Traore and Ross Barkley.
It had an instant impact, Pienaar heading wide when he should have scored before Naismith pounced on Taylor's backpass as it fell short, and steering a composed finish under Tremmel as he came out.
Mirallas should have made the game safe for the home side from Seamus Coleman's cross but blazed his shot well over the top from 10 yards.
Everton did not have to wait long for a third and once again Naismith was involved, brought down by Richards as he moved into the area. Baines, as reliable as ever from the spot, sent Tremmel the wrong way.
Check out all the best photos from Sunday's FA Cup fifth-round ties on the BBC Sport Facebook page.
- 01 Robles
- 23 Coleman
- 03 Baines
- 18 Barry
- 06 Jagielka
- 15 Distin
- 11 Mirallas (Deulofeu - 87' )
- 16 McCarthy
- 28 Traore (Naismith - 61' )
- 20 Barkley (Osman - 61' )
- 22 Pienaar
- 02 Hibbert
- 07 McGeady
- 10 Deulofeu
- 14 Naismith
- 21 Osman
- 24 Howard
- 26 Stones
- 25 Tremmel
- 29 Richards
- 03 Taylor
- 21 Cañas Booked
- 27 Bartley (Williams - 31' )
- 02 Amat Booked
- 11 Hernández
- 20 De Guzmán
- 26 Alvaro
- 15 Routledge (Dyer - 45' )
- 14 Lamah (Lita - 69' Booked )
- 01 Vorm
- 06 Williams
- 07 Britton
- 10 Bony
- 12 Dyer
- 18 Lita
- 19 Tiendalli
Ref: Kevin Friend