Zimbabwe have written their names into the Test cricket record books, becoming the first team in the format's 149-year history to score more than 500 runs in both innings of a match, during a remarkable drawn first Test against Afghanistan at the Sharjah Cricket Stadium.

The Chevrons posted 504 in their first innings and then piled up 523 for five declared in the second, an aggregate of 1,027 runs that is the fourth-highest match total ever recorded by a team in Test cricket. Afghanistan replied to the first innings with 514 of their own, making it the first Test match ever to feature three totals of more than 500.

The match ended in a draw on Monday, the fifth and final day, when the two captains agreed to call it a day after Zimbabwe had batted through the day. Zimbabwe's second innings ended 513 runs ahead, but with no time left for a result on a pitch that offered the bowlers almost nothing across five days.

Captain Craig Ervine was the hero of the second innings, finishing unbeaten on 206 from 279 balls, his maiden Test double century. At 41 years and 82 days, he became the third-oldest player ever to score a double century in Test cricket, behind only South Africa's Eric Rowan and England's Jack Hobbs, and only the fifth Zimbabwean to pass 200 in a Test, after Dave Houghton, Andy Flower, Guy Whittall and Grant Flower.

Ervine was joined in an unbeaten 208-run stand by Wessly Madhevere, who brought up his maiden Test century and finished on 100 not out. The partnership was Zimbabwe's highest ever for the sixth wicket, and it carried the side safely through the final day after the early wickets had fallen.

The first innings had set the tone. Brendan Taylor struck 131 from 168 balls and Brian Bennett made an unbeaten 128 as Zimbabwe reached 504, only for Afghanistan to answer with 514, led by captain Rahmat Shah's 173, with Rahmanullah Gurbaz making 113 and Sediqullah Atal 105. It was a match in which the bat dominated from the first morning, and the bowlers were left chasing the game.

In all, Zimbabwe scored four individual centuries across the two innings, the most they have ever managed in a single Test, and their aggregate of 1,027 runs made them only the seventh team in history to pass 1,000 runs in a Test match. Their previous highest match aggregate had been 885 against India in Nagpur in 2000.

The scale of the run-scoring was underlined by the match statistics. Three totals of more than 500 had never before been recorded in a single Test, and only two other first-class matches in history, a Ranji Trophy semi-final in 1948-49 and a County Championship game in 2001, had ever produced the same feat. On a flat Sharjah surface, the bowlers toiled without reward: Newman Nyamhuri took five wickets in Afghanistan's innings, but no bowler on either side could force a result.

For Zimbabwe, a side that has spent much of its recent history fighting for relevance and fixtures, the record carries meaning beyond the numbers. It was the first time the team had ever scored 500 or more in both innings of a Test, and it came against an Afghanistan side that has become one of the most competitive in world cricket. The draw keeps the two-match series level, with everything to play for in the second Test.

The second and final Test begins at the same venue on Friday, 13 November, and runs until 17 November. Both teams will know that the Sharjah pitch is unlikely to change its character, so the bowlers will again face a long week, but Zimbabwe will arrive with a piece of history already secured and the belief that their batting can match anyone on its day.