The result sees Ireland and France into the quarter finals and next week's final Pool D match between the two will decide who will play defending champions New Zealand in the next round.
Centre Keith Earls broke Brian O'Driscoll's Irish World Cup record with his eighth touchdown in two tournaments. But Ireland badly needed Jonny Sexton's 11 points from the boot for the win.
"I apologise to all the Irish fans. It was a very disappointing performance," said Irish captain Paul O'Connell.
"We couldn't get going at all and dropped too many balls. We just hope we can discover our form from the two previous games for next week's game (against France)."
Italy did not have the greatest of starts.
Captain Sergio Parisse looked to shake the cobwebs off on his return from injury but dropped a simple pass offered to him and the Italians were further hit when centre Gonzalo Garcia limped off in the fourth minute.
Sexton put the Irish into the lead with a penalty in the ninth minute after his darting run had created the opportunity.
The Italians, though, camped in Irish territory for five minutes and won a penalty which Tommaso Allan slotted over to level affairs.
The Irish responded brilliantly with a superb try, winning a lineout close to the Italian line and passing it down the line. Sexton offloaded brilliantly to Robbie Henshaw who passed to Earls and he was not going to be stopped on his way to the line.
Sexton converted to put the Irish in a good position to take control at 10-3 but Allan again punished the Irish with a penalty in the 19th minute as the Italy pack put their opponents under pressure.
Work to do
Things did not go Ireland's way in a scratchy first-half. Sexton's long range penalty attempt came back off a post and into Parisse's arms.
Parisse led a terrific Italian defence against a surge of Irish attacks as the half neared its end.
The Six Nations champions came away with nothing as O'Connell opted for a try attempt rather than a penalty kick. But from the ensuing play scrum-half Conor Murray knocked on and, reflecting his side's poor performance, flung the ball to the ground in a fit of pique.
The start of the second-half carried on in the same vein with Irish harried into errors and the Italians creating opportunities. Josh Furno was found on the left only a few metres out but Peter O'Mahony heroically got his legs into touch before the lock touched down.
However, Irish ill-discipline let them down again as Allan landed a superb penalty from wide out on the left to reduce Ireland's lead to just a point with 30 minutes to play.
Sexton gave them a little breathing space with a penalty as the game neared the hour mark for a 13-9 lead. He added another three points on the hour to put the Irish a converted try ahead.
The Italians clung on tenaciously and penetrated the Irish line on several occasions only for their opponents to do just enough to hold them off.
Parisse's legs finally gave in in the 64th minute and he recevied a resounding round of applause as he departed.
There was not a similar reaction to when O'Mahony was sin-binned in the 72nd minute. Boos rang out after he shoulder charged the head of an Italian at a ruck.
The result did not impress Ireland's followers.
O'Driscoll said on ITV that Ireland have "an awful lot of work to do" before playing France next week.
"We are going to have to perform a lot better than that if we are going to advance as pool winners."