Playing their sixth test match, the Afghans racked up 545-4, their highest total ever, before captain Asghar Afghan declared their first innings.
Their previous highest total was 342 when they beat Bangladesh in 2019 to register their first Test victory.
The skipper himself hit 164, which was briefly the highest Test total by an Afghan batsman until Shahidi eclipsed it.
The 307-run fourth-wicket stand between them was also the biggest partnership for Afghanistan who played their first test against India in 2018.
Shahidi took a single off Donald Tiripano to bring up his double hundred. He celebrated it with a roar, while team mates gave him a standing ovation and Zimbabwe players walked up to congratulate him.
First Afghanistan player to score a Test double ton!Take a bow, @Hashmat_50 🔥#AFGvZIM https://t.co/rJeKIYmmXS
— ICC (@ICC) 1615461698000
Shahidi faced 443 balls for his 200 not out, which included 21 boundaries and a six.
At stumps on Day 2, Zimbabwe were 50 for no loss, trailing by 495 runs in their first innings.
Zimbabwe had won the opening Test at the same venue inside two days.