Mahela Jayawardene's 19th ODI century helped to dig Sri Lanka out of a hole and send them on their way to a four-wicket win over a spirited Afghanistan in Dunedin.
Jayawardene, who hit eight fours and a six before departing on 100, combined with skipper Angelo Mathews (44) to get Sri Lanka back on track after their top order crumbled.
They were down to 51 for four after 12 overs in pursuit of 233 before Jayawardene and Mathews piled on 126 in a vital fifth-wicket stand.
Thisara Perera then took charge with 47 from 26 balls to see them over the line as they reached 236 for six with 10 balls to spare at the University Oval to get their World Cup campaign up and running.
It was hard on Afghanistan, who looked to have their opponents on the ropes as Hamid Hassan took three for 45 runs.
Watch Cricket World Cup highlights on ITV4 tonight at 10pm