A day before Afghanistan's second Test, Rashid Khan spent more time nursing his finger than actually bowling. He batted for a long time, then walked into the dressing room, spent time with the physio, came out towards the end of the nets session, bowled some lobs to another member of the support staff, had his finger checked again, and then finally bowled in a net. He looked in discomfort. He avoided fielding the ball with his right hand, and repeatedly twisted his left hand to collect the ball thrown back to him. After two or three overs of bowling, he went back to getting his finger examined.

It was the middle finger on the right hand that was injured and swollen. By classification, Rashid is a wristspinner, but he himself acknowledges he uses his fingers more than most other wristspinners. He went off at the end of the nets session with his finger in a cup full of ice. He was racing against time to be ready for the Test - only Afghanistan's second in nine months with their next Test not yet inked - but you could see he was struggling.

You wondered if Rashid would be ready. ESPNcricinfo checked with Mohammad Nabi if he was going to make it. "Don't worry about him," Nabi had said. "Even if he is hurting through the match, he will play."

To a man, every Afghanistan cricketer acknowledges Rashid's commitment to the national team even though much of his fame has come from playing the T20 leagues. There was no way he was going to miss this Test. He began it uncertain, often using his left hand to field the ball. Thirteen overs in, he got the ball. Afghanistan had turned it around after a loose start. Ireland had two new - and uncertain - batsmen at the wicket. Rashid bustled in, bowled the perfect wrong'un first, beating the inside edge of James McCollum and pegging the off stump back. Who writes his scripts? He had done the same last year in Afghanistan's first T20I at this venue, their adopted home ground.

I shouldn't have any excuse with a finger injury, these are related with sportsmen and I accepted that
RASHID KHAN

It was Nabi that Rashid rushed to and pointed to after that first-ball magic. Two balls later, Stuart Poynter missed a full-toss, and Test cricket seemed easy. Soon, though, the realities of Test cricket became apparent. These were uncertain batsmen he got the better of. Once they got in, once they started to give themselves time, they could even play Rashid off the pitch even if they didn't necessarily pick him from his hand. Over the next 11.3 overs, he got no wicket. In those 69 balls, batsmen were not in control 12 times; the 17% rate inferior to the innings' overall rate of 23%.

The barren patch continued into the second innings when Andy Balbirnie and McCollum played him with certainty. He grew desperate, began to try too many things too early, started going round the wicket, tried to bowl them around the pads, tried big wrong'uns. He looked angry, frustrated. And this was a third innings where Ireland were threatening to turn around a first-innings deficit into a lead. When he walked back for lunch, he didn't peel his eyes off the big screen showing the highlights of a session in which Ireland lost just one wicket - that too to an ordinary umpiring call - and added 102 runs to now sit only 18 in deficit with eight wickets in hand.

Rashid had by now bowled 16 overs for 39 runs and no wicket. Those who know Rashid say he is an extremely competitive cricketer; he is not fun to be around when it is not going his way. Most of all, at this point he would have known he was the biggest star of the side, he was expected to seal the deal in the third innings, but here he was, unable to even create pressure. Memories of his struggles against India and Shikhar Dhawan in particular in Afghanistan's debut Test were all coming back. Fighting a painful finger that severely hampered his ability to grip the ball, trying to adjust to a format he rarely gets to play, in the face of stern Irish resistance on St Patrick's Day, Rashid had now gone 165 balls without a wicket.

Try taking that ball out of his hand, though.

He had gone unchanged for 13 overs, and would continue to do so for ten more. Those ten were to be crucial to where Afghanistan went. The left-arm wristspinner Waqar Salamkheil provided the breakthrough with a ball that didn't turn as much as expected, and then Rashid barged through.

Now the ball had also become older and softer. Rashid was able to grip it better. "It was tough to grip the new ball because I had the finger injury as well," Rashid said. "With the new ball it was difficult for me to pitch it on the right length because it was paining a lot. Once the ball gets older and the seam has gone so it was more comfortable for me to bowl than the new ball. Spots on the wicket, there was something for the spinners after lunch. I think we took advantage of that and bowled in good-length areas and got the results.

"It was tough to bowl in that time [before lunch] because the new ball was quite difficult to grip but I just tried my best. You have to do for the team, you have to do for the country. Whether you are doing well or not doing well, you have to stand up and give 100% for the team. That's what I was trying. To deliver as much as possible and as good as I can. I shouldn't have any excuse with a finger injury, these are related with sportsmen and I accepted that."

When Rashid finally took a break, he had taken two wickets and helped curb Ireland's comeback. In the ten overs that he stayed off, Ireland added another 30 without losing a wicket, and were now effectively 67 for 6. Danger man Kevin O'Brien was still at the wicket. The lower order was stubborn in the first innings; they were putting up a bigger fight now. Rashid, though, kept attacking the stumps and got both the set batsmen, O'Brien and George Dockrell, out.

It shouldn't really be any surprise that Afghanistan's first five-for in Tests has gone to Rashid, but this was a test of his adaptability to this format. It tested both his skill and his injured finger. This was only his sixth first-class match, so it might be a little unrealistic to expect him to bowl like seasoned accurate spinners in the face of batsmen happy to play him out. He doesn't have a first-class structure to hone his game; all his struggles have to be carried out in the spotlight of the Test arena. The fact remains that Afghanistan are less favourites at the end of the third day than they were at the end of the second, but it could have been far worse but for Rashid's persistence.

Sidharth Monga is an assistant editor at ESPNcricinfo