The left-hander was resolute, facing 256 balls and batting for nearly the entire day. He had to knuckle down early — scoring seven from his first 47 balls, and avoiding being given out lbw by the narrowest of margins when on 16.
A delivery from Kasun Rajitha had pitched – just – outside leg stump, and after surviving the scare, Latham picked up the pace, playing some textbook cover drives as he wrestled control against the Sri Lankan bowling attack.
He added 162 in partnership with Williamson, who looked almost certain to bring up his 20th test century in a fantastic innings.
Listen to "Black Caps v Sri Lanka - First test, day two highlights" on Spreaker.
With Williamson, the most impressive thing now is not the runs, but the fact the runs are so expected, especially versus Sri Lanka, against whom he averages 91.
He was on top from the start, striking three boundaries off the first three balls, and looked in another stratosphere as he rattled along at a run a ball. Any cries of catch were more in hope than expectation, with an array of glorious back foot cuts and drives complementing superb accumulation and excellent running between the wickets.
A Williamson century all seemed so pre-ordained, so there was a stunned silence around the Basin Reserve when he swept part-time spinner Dhananjaya de Silva straight to the man at backward square leg. Williamson had to go for 91 from 93 balls, but while he couldn't reach three figures, Latham made sure someone would raise their bat by the end of the day.
It came in classic circumstances – sprinting through for a quick single on 98, before a misfield allowed him to scamper back for a second, and salute an appreciative crowd.
It was a timely knock after the 26-year-old had averaged just 16.5 in the series against Pakistan, but Latham said he was always confident he would perform on his return to New Zealand conditions.
"I didn't have the results I wanted in the UAE, but I certainly felt that I was hitting the ball alright, so the biggest thing for me was the trust in my game – that I can do it at this level.
"It's been a while since I made a big score but it was nice that I managed to do that straight away."
He found further support from Taylor, who finished unbeaten on 50, in the process passing Brendon McCullum for second all-time on the New Zealand runscoring charts, with 6456 runs.
For Sri Lanka, it was a day of toil, with little to indicate day three will produce anything different. Lahiru Kumara bowled with some fire, and took the wicket of Jeet Raval, but the rest of the seam brigade were unthreatening. Compared to the efforts of Tim Southee – who ended with 6-68 after wrapping up the Sri Lankan innings early in the day – the Sri Lankan seamers looked second-rate, creating few chances, and spinner Dilruwan Perera leaked runs in his 13 overs.
It all points to a substantial first innings advantage for the Black Caps – and, most likely, a first test victory.