Wilfried Bony scored twice to take Ivory Coast into the semi-finals of the Africa Cup of Nations.
The new Manchester City striker headed the Elephants in front from a right-wing cross by Max Gradel.
Hilal Soudani equalised for Algeria against the run of play early in the second half and then forced goalkeeper Sylvain Gbohouo into a brilliant save.
Gbohouo was rewarded when Bony headed in Yaya Toure's free-kick and Junior Tallo set up Gervinho for a late third.
The margin of victory flattered Ivory Coast in what was an even contest and before former Arsenal striker Gervinho confirmed the result on the break, they had been under pressure from Algeria.
Their defence seemed all over the place at times and semi-final opponents DR Congo will have taken note.
Algeria, in the quarter-finals for the first time since 2010, made the brighter start to the contest and almost went ahead in the ninth minute.
Yacine Brahimi raced into the left-hand side of the penalty area and the Elephants' defence failed to deal with his cross, allowing Soudani to get in a shot which was well held by Gbohouo.
Ivory Coast boss Herve Renard was ordered by the referee to put a bib over his white shirt as it clashed with Algeria's kit
In the 21st minute, Riyad Mahrez volleyed over from close range but then Ivory Coast hit back.
Two minutes later, Gradel floated in a free-kick from the left and Serge Aurier's downward header hit the base of the post and then in the 26th minute they took the lead.
Gradel was again involved as he delivered a testing cross from the right and Bony escaped the defence to head home from eight yards.
Bony shot wide from distance towards the end of the first half before at the other end, Saphir Taider's sharp volley was confidently saved by Gbohouo.
The start of the second half mirrored the start of the first with one team dominating but the other one scoring.
This time Ivory Coast were the team who started on top but a comedy of errors in their defence after a deep cross into their penalty area finally saw the ball fall to Soudani, who fired it home.
Algeria goalscorer Hilal Soudani plays his club football for Dinamo Zagreb
That sparked a spell of dominance from the Desert Foxes with Gbohouo twice having to clear his lines before he made an amazing 66th minute save from Soudani's point-blank effort.
The momentum changed and two minutes later Bony restored Ivory Coast's lead when he climbed highest to head Yaya Toure's set-piece inside the near post.
Algeria piled on the pressure in the closing stages but could not find an equaliser and Gervinho finished them off when he passed the ball into the net.
Latest Stories
-
UCC elects Abraham Norman Nortey as 62nd SRC President
4 mins -
“My goal is to get my music all over the world, not just nominations” – Stonebwoy
9 mins -
Ghanaian youngster Gabriel Quartey set to sign for Danish side AaB
13 mins -
Elmina residents threaten gov’t with the wrath of their gods over collapse of Nduom’s businesses
16 mins -
At least 14 killed, houses swept away in Uganda landslide after heavy rainfall
28 mins -
Empowering the future of journalism: Dikan Center launches inaugural fellowship
28 mins -
Mortuary workers declare another strike over conditions of service
30 mins -
Jospong Group and Zoomlion host peace walk and evangelism ahead of elections
36 mins -
Speaker has taken Parliament as his personal property, opens it when he likes – Afenyo-Markin
47 mins -
Shatta Wale donates GH₵ 20,000 to artist for her tertiary education
53 mins -
Hungary backs Moroccan autonomy plan as credible solution to Sahara dispute
59 mins -
Standard Bank signs agreement with IFC to expand local currency lending in Africa
1 hour -
Australian Senate approves social media ban on under-16s
1 hour -
Ghana to host National Para Powerlifting competition on World Disability Day
2 hours -
Judge transferred just before judgment delivery in OSP’s corruption case against failed Juaben MCE nominee
2 hours