The home side threatened early on. Jesse Lingard lifted a corner in from the right and the ball was not cleared properly by Aitor Karanka's side and fell to Darius Dudka, but he could only scuff an effort wide of the post.
© Getty Images
Dudka would be made to pay for that missed chance as Boro took the lead in the 22nd minute.
Albert Adomah almost doubled the visitors' lead when he raided down the right but he could not flick the ball over Randolph as the keeper advanced and was able to make the save.
After half time, the hosts got themselves back in the game when Chris Burke was brought down in the penalty area and they were awarded a spot kick.
Paul Caddis made no mistake in firing the ball home, sending Shay Given the wrong way.
However, Middlesbrough came back at them and Randolph was forced into a brilliant save to deny Kei Kamara when his header looked set to find the net after he had latched onto Adomah's cross into the penalty area.
The visitors did get their goal eventually when they won a free kick that was launched into the penalty area and Lukas Jutkiewicz knocked the ball down into the path of Daniel Ayala, who prodded it home from close range.
However, in stoppage time Birmingham found a leveller as Bartley powered a header into the net from a corner from the right to earn his side a point.