GALLE, Sri Lanka (AP) — Jean-Paul Duminy came up with a timely century Thursday that helped South Africa declare its first innings at a formidable 455-9 on the second day of the first test against Sri Lanka.

The left-hander was unbeaten on 100 when South Africa captain Hashim Amla declared midway into the final session.

Sri Lanka was 30-0 in reply with Upul Tharanga on 20 and Kaushal Silva on eight.

Batting at No. 8, Duminy struck 10 fours off 206 balls during his fourth test century to build on a fine half-century by wicketkeeper-batsman Quinton de Kock earlier in the first session.

Duminy frustrated the home side as he figured in two partnerships that helped South Africa gain a slight edge and make up for a middle order slump on the first day. He was comfortable from early on and was quick to jump out of the crease, sweep or even reverse-sweep the spinners in order to unsettle them.

Duminy added 75 runs for the eighth wicket with Vernon Philander (27) and 66 for the next with Morkel (22), which was a record for the ninth wicket for South Africa against Sri Lanka.

Duminy was dropped by Dilruwan Perera at mid-off off left-arm spinner Rangana Herath when on 82 and went on to complete the century with a single to the leg side. Morkel was out the very next delivery as he tried to heave off-spinner Perera, who was the most successful for Sri Lanka with 4-162.

Earlier, wicketkeeper-batsman de Kock chipped in with a useful 51 off 90 balls with six fours to ensure there were no setbacks for the visiting side.

Left-hander De Kock, playing only his second test as A.B. de Villiers is restricted by injury and cannot keep wicket, carried his form from the preceding one-day series that South Africa won 2-1.

De Kock struck a century in the one-day series decider and looked set for a big score Thursday before he was caught by Mahela Jayawardene at slip off a delivery from Perera that turned viciously to give a glimpse of what can be expected from the pitch in the coming days.

South Africa is looking to maintain its admirable away record and has not lost a series abroad since its last tour of Sri Lanka in 2006 under Ashwell Prince.