Shaminda Eranga and Rangana Herath had left the hosts wobbling on 117 for five at tea, while Nuwan Kulasekara removed Matt Prior soon after the interval to raise Sri Lankan hopes of a first test win at the home of cricket in seven attempts.
However Ballance’s century in his second test, brought up with a six over square leg on the first ball of the day’s final over, and Jordan’s positive approach on his debut took England’s lead to 389 at stumps.
“It’s a great feeling, I can’t really describe it to be honest, it’s very special and I’m over the moon at the moment,” Zimbabwe-born Ballance, whose parents and brother flew to London to watch the match, told a news conference after becoming the fourth player to score a century in the match.
Ballance, batting at number three, and Jordan displayed the discipline lacking from some of their team mates whose dismissals had raised the possibility of a result on a pitch that appeared to favour a draw.
England, should they decide against declaring, will commence the fifth and final day on 267 for eight with Balance 104 not out and Liam Plunkett on two.
Earlier in the day Sri Lanka captain Angelo Mathews, who along with Kumar Sangakkara (147) helped Sri Lanka pass the follow-on target in Saturday’s evening session, brought up a well-deserved third test century when he smashed a James Anderson full toss through extra cover.
The attack-minded Mathews was unable to push on, however, falling lbw to Plunkett for 102 from the next ball he faced.
Jordan wrapped up the innings for 453 in rare fashion, causing Nuwan Pradeep (4) to strike the wickets with his bat after being struck on the shoulder by a bouncer.
Alastair Cook and Sam Robson eased through to lunch but did not last much longer, with the captain feathering an edge on 28 through to Prasanna Jayawardene off Eranga, who had opened his spell with three consecutive maidens.
Cook has not reached three figures in his last 22 test innings and will rue missing the chance to build some confidence on a placid pitch, albeit one that may offer some encouragement for the spinners on the final day.
Eranga doubled his wicket tally in his next over, getting through Robson’s defenses to complete a tough test debut for the Middlesex 24-year-old who was dismissed for one first time out and only managed 19 on Sunday.
Ian Bell, playing his 99th test, went the same way as the hosts teetered at 69 for three, Eranga having taken three wickets for three runs off 21 balls.
Ballance and Joe Root appeared to have knuckled down before left-arm spinner Herath caught the latter, who compiled his maiden double-century in England’s first innings, on the back leg dead in front.
Moeen Ali, making his debut alongside Jordan and Robson, hit the first ball he faced back down the pitch for four but Herath found a gap through bat and pad to shatter the stumps with his next delivery, while Prior tamely cut Nuwan Kulasekara to Lahiru Thirimanne in the gully after tea.
Ballance struggled to find the gaps early in his innings, at one stage going 26 balls without troubling the scorers in the lead up to tea, but he fought his way through to a half-century to stem the flow of wickets alongside Jordan, who fell for 35 after looping a ball from Herath to Sangakkara at mid-off.
Ballance then combined with Stuart Broad to effectively bat Sri Lanka out of the match, putting on 57 in just over seven overs.
The 24-year-old left-hander said while it would be difficult to take 10 wickets in a day, he was confident they had the strength in the attack to make life difficult for the Sri Lanka batsman.
“It will be tough, but as Sri Lanka showed there, they got eight wickets in 60-odd overs so it’s possible, especially under pressure, if we can get a few early wickets then we’ll definitely have a good chance,” he said.
Thirimanne paid tribute to Eranga for his inspired spells before and after lunch that altered the direction of the match.
“He bowled really well, as a fast bowler in these conditions, he bowled good area,” he said.
“The ball that got out Ian Bell was fantastic, we are hoping he will continue this good form.”
(Editing by Pritha Sarkar and Martyn Herman)