Amir has not played a first-class match since August 2019, when he played a Championship game for Essex a month after his retirement from Test cricket.
“The County Championship is an amazing competition and I can’t wait to get going with Gloucestershire,” Amir said. “I love playing in English conditions and I’m feeling really good, so I hope I can perform well for the team.”
Steve Snell, Gloucestershire’s performance director, said: “We are delighted to have signed a bowler of Amir’s calibre. We will sadly be without Naseem for a few weeks due to injury and while we help him get back to full fitness, Amir will provide us with quality and international experience in our seam attack for what is a strong first-division competition.
“Amir fits the bill perfectly for what we need and we’re confident he will be a great addition to the squad for those three matches. He has indicated his hunger and desire to make pivotal contributions during his time with us and we look forward to making him feel welcome in Bristol with Gloucestershire.”