It was one of those nights when the woodwork made all the difference. With five minutes remaining the width of the post denied Gareth Bale a second goal that would have put this crucial game to bed and less than 60 seconds later the Serbia bench exploded with joy after Aleksandar Mitrovic, the Newcastle United striker, scored via the upright at the other end.

Wales were crestfallen, disappointment written all over their faces at the final whistle after two precious points slipped through their fingers for the third consecutive match in a World Cup qualification campaign that has stalled. “The players are absolutely devastated,” Chris Coleman, the Wales manager, said.

A win over a strong Serbia team would have made up for the frustration of being pegged back at home against Georgia last month and allowed Wales to apply some pressure on the Republic of Ireland at the top of the group. Instead Wales will travel to Dublin in March with no margin for error. Coleman’s team sit third in Group D, four points adrift of Ireland and two behind Serbia, whom they face in June in another tricky away game.

From Coleman’s point of view, coming up against Martin O’Neill’s side next is just what Wales need. “It’s probably the best game – we couldn’t have chosen a better one,” he said. “We know it’s going to be one of the hardest games and that’s what we need. We’re going to go into a fantastic atmosphere at the Aviva Stadium and Ireland are playing on the front foot, playing with confidence – they deserve to be top. It’s going to be a fantastic test and challenge for us, and we look forward to that.”

Wales will have a long time between now and then to mull over the opening four qualification matches and in particular the dramatic chain of events that saw this match swing one way and then the other in the closing stages. Bale, who registered his 26th international goal to move within two of Ian Rush’s all-time scoring record, will curse the moment when his low, angled right-footed shot rebounded off the post after Aaron Ramsey had set him free.

Wales 1-1 Serbia: World Cup 2018 qualifier – as it happened Read more

Questions will also be asked about whether Wales could have done more to prevent the goal that Serbia pilfered moments later, when Antonio Rukavina was given the room on the right to deliver a cross that Mitrovic, getting in front of James Chester, brilliantly headed home. The ball hit the upright and ended up in the net via Wayne Hennessey’s gloves, almost crossing the line in slow motion to add to the sense of despair among the home supporters.

“That’s football,” Coleman said. “We’re an inch away from going 2-0 up and then the game is finished – we’ve got the three points. Seconds later the ball’s in the back of our net. We hit the post and it pops out, they hit the post and it goes in, it’s like that sometimes unfortunately. It would have been a great point if we’d beaten Georgia, and we should have taken care of business there. But I thought we were more or less back at it tonight with our performance, we had that edge back in our game – and you need that against a team like Serbia. No complaints from our players, I thought they gave everything they had, deserved more, deserved better. I think apart from the goal in the second half I can’t remember Wayne Hennessey having anything to do really, just a couple of crosses. So to give up two points late on was a bitter pill to swallow.”

Set up in an unfamiliar 4-2-2-2 formation, Wales took the lead on the half-hour mark with a goal that owed much to the persistence of Hal Robson-Kanu, who dispossessed Matija Nastasic, the former Manchester City defender, and then had the presence of mind to look up and pick out Bale. About 20 yards from goal, he thumped a low shot that flashed past Vladimir Stojkovic, the Serbia goalkeeper, who was partially unsighted as Branislav Ivanovic tried to block. Shortly afterwards Robson-Kanu headed a Bale cross narrowly wide.

Serbia, however, also had their moments in the first half. Neil Taylor cleared Ivanovic’s header off the line and Nemanja Matic drew a decent save from Hennessey on the stroke of half-time.

It was a frantic game, spiky at times and threatened to boil over on a couple of occasions. Dusan Tadic was left bloodied after Taylor accidentally caught him on the nose with a high kick and a total of seven yellow cards were brandished. The most telling blow, though, was landed by Mitrovic four minutes from time and left Wales with plenty to do to get back on the road to Russia.