Algeria will head to the FIFA World Cup with momentum after beating Romania 2-1 in their final pre-tournament friendly on Wednesday.
Vahid Halilhodzic's side produced a largely uncovincing performance, but did enough to head to Brazil with another win to their name following a 3-1 triumph over Armenia last Saturday.
Winger El Arbi Soudani's effort midway through the second half settled the game in favour of the Africans after Romania midfielder Alexandru Chipciu had cancelled out Nabil Bentaleb's 22nd-minute opener.
The contest in Geneva was marred somewhat by ugly scenes in the stands at Stade de Geneve,with the game brought to a halt near the end of the first half after objects were thrown onto the pitch.
Algeria will now travel to Brazil ahead of their opening World Cup game with Belgium on June 17.
It was Algeria who dictated the play early on, and they would have taken the lead in the 17th minute had Sofiane Feghouli not side-footed his shot over when presented with a great opportunity six yards out.
However, Halilhodzic's men did go ahead five minutes later as Bentaleb netted a scrappy goal.
Abdelmoumene Djabou cleverly worked his way down the left before delivering a cross that Romania goalkeeper Costel Pantilimon failed to handle, allowing Bentaleb to bundle the ball home.
Yet it did not take long for Romania to craft a reply, the equaliser arriving in the 28th minute as Chipciu coolly slotted home, rolling the ball into the net after rounding Rais M'Bolhi from Alexandru Maxim's throughball.
Maxim could have completed the turnaround for Romania in the 43rd minute, but the winger failed to connect with Cristian Tanase's cross with the goal at his mercy.
The referee then took the players off the pitch after an object was thrown at one of the match officials from the stands, with Halilhodzic pleading to the Algerian fans for calm during the stoppage.
Upon the players' return, the final two minutes of the first half were completed, with the two teams then quickly swapping sides and beginning the second period.
Chances proved few and far between for much of the second half, although Bentaleb wasted an opportunity to score a second, producing a disappointing finish after being teed up just outside the six-yard box.
Algeria did eventually get in behind the Romania defence again, and they were rewarded as Soudani converted from Saphir Taider's perfectly placed right-wing delivery in the 66th minute.
A third goal almost arrived nine minutes later, but substitute Riyad Mahrez was denied by a brilliant one-on-one save from Pantilimon.
Hassan Yebda scuffed a seemingly simple chance wide late on but it mattered little as Algeria comfortably held on for the victory.