Might Pakistan have seen their best chance of achieving the No. 1 Test ranking slip through their grasp?

They have never been rated the best Test team. Not officially, anyway. There was a couple of months in 1988 when they would have been had the ratings been in existence, but since they were introduced in 2003, Pakistan have never reached the pinnacle.

They have been within sight of it here. For a while, as Australia capitulated in Galle, and Pakistan inched towards a first innings lead, the top of the mountain was clear above them. But, by the close of play the clouds had obscured the view once more. There is no guarantee they will part.

Pakistan had been, remember, 257 for 2 with moments to go before stumps on the second day. They were just 40 runs behind England and they had eight wickets in hand. With James Anderson having twice been warned for running on the pitch, Steven Finn battling for rhythm, Stuart Broad unable to coax much pace or movement from this surface and Moeen Ali conceding more than four-and-a-half an over, Pakistan's batsmen had an outstanding opportunity to bat England out of the game. There are no horrors for them in this low, slow wicket. England have taken no home advantage.

But it was not to be. Azhar Ali, understandably weary after more than six hours' of batting, was drawn into poking at one away from his body and edged to slip at the end of day two and Pakistan's middle-order was unable to fully capitalise on the foundations that he had built.

A first innings lead of 103 wasn't bad. Not by any means. But it wasn't the vice-like grip Pakistan could have taken on this match. It was an advantage, certainly, but it wasn't definitive. It was, in truth, something of a missed opportunity.

It would be unfair to state that Pakistan squandered their chance with the bat. Unfair on Pakistan and England, who battled hard, bowled with impressive control and then batted particularly well when they started their second innings on Friday.

Asad Shafiq, perhaps undone by Broad going wide on the crease, missed a straight one, Younis Khan was caught down the leg side as he fell over towards the off and once Misbah played on, there was nobody to stay with Sarfraz Ahmed and extend the lead.

There were some familiar faults. The Pakistan tail, with Yasir Shah (a man with a Test batting average of 11.75) at No. 8, has more than a hint of the Diplodocus about it and here mustered just 18 between four men from No. 8 to No. 11. Since January 2014, they are worst performing lower-order in the world.

As Mickey Arthur, the coach, put it afterwards: "we lack an allrounder; we lack a Chris Woakes. We've got to pick our best six batsmen and our best bowing attack. To win Tests, you have to take 20 wickets."

And then Pakistan's four-man attack was shown-up once more. It's not that there is anything wrong with any of the bowlers - far from it - but that it leaves no margin for error. Sohail Khan, so impressive in the first innings, looked stiff and tired - not injured as much as not fit enough to bowl the amount of spells required at this level in a four-man unit - while Rahat Ali delivered too many loose deliveries.

That left too great a burden on Mohammad Amir, who is bowling considerably better than his figures suggest in this series, and Yasir, who is clearly a fine bowler operating on a surface offering him little. Pakistan were unable to build pressure and England's openers were able to record their first century partnership with one another. A day that started with Pakistan well in front ended with England ahead by a nose.

Arthur described the second innings bowling as "poor." "I was just really disappointed," the Pakistan coach said. "Everything we've spoken about, everything we've done… We talk about lengths all the time, we talk about bowling one side of the wicket, we talk about bowling plans and controlling the rate. We didn't do one of those in the last session, so that was particularly disappointing.

"Sohail is a real concern. He's got to back up. I thought he bowled exceptionally well in the first innings but you've got to do it both innings, you've got to do it spell after spell. That's something we'll continue to work with Sohail Khan on."

"I love Rahat. I think he has something special. If we can get Rahat's action repeatable, he's going to be very, very good.

"But they'll bowl five fantastic balls with the new ball and then there's the one dragged down or there's the one on leg stump which is the four-ball and that's been giving the England openers a bit of a start. We've got a lot of work to do technically with our bowlers."

None of this means that Pakistan have lost their opportunity to reach No. 1. It might still happen. This game remains in the balance - wonderfully so in the grand scheme of things - and Pakistan will be the favourites when West Indies arrive in the UAE for a Test tour in a few months.

But this game, the next seven days of the series, do present a great opportunity. Some of the key players in the Pakistan side are surely coming to the end - Younis, with a highest score of 33 in the series, seems to be in decline and even Misbah, now aged 42, might eventually have to accept he can't win his fight with Time - and, within a few weeks, other teams (notably India) will have opportunities to pick-up ranking points. Not long after the West Indies series, Pakistan face testing trips to New Zealand and Australia. It may be a long time before Pakistan go this close to the summit.

Were Pakistan to reach the No. 1 ranking, it would surely have to be recognised as one of the great achievements in the sport. From the position this side were in when Misbah took over - with four squad members eventually banned for corruption and, before long, his leading spinner squeezed out of the game due to concerns over his bowling action - and to have come this close despite not playing a single Test at home is beyond admirable. It is almost miraculous.

Whatever happens next, this Pakistan team's achievements demand respect. But they may never have a better chance to go all the way and they may come to reflect on day three at Edgbaston as the day it slipped away.

George Dobell is a senior correspondent at ESPNcricinfo