The Proteas batsman will join Surrey ahead of the club's opening fixture against Hampshire on April 20 and could feature in eight fixtures before the end of May
Elgar replaces Australia's Mitchell Marsh who requires ankle surgery.
The Proteas batsman will join Surrey ahead of the club's opening fixture against Hampshire on April 20 and could feature in eight fixtures before the end of May.
He will be available for the majority of the first two months of the season before leaving ahead of South Africa's tour of Sri Lanka.
Elgar will be unavailable for the Championship fixture against Worcestershire due to a "pre-arranged commitment".
The 30-year-old is returning to Surrey after making three appearances for the London-based club in 2015.
The left-hander has scored 3,194 Test runs for his country, hitting 11 centuries. He produced 333 runs at 47.57 in South Africa's recent 3-1 series victory over Australia.
In a statement on Surrey's website, Elgar said: “I am really grateful for the opportunity to be back at Surrey for the start of the summer. I hope to contribute for the period I am at the club, on and off the field, and I’m looking forward to seeing all involved at the great club again.”
Director of cricket Alec Stewart added: “Given the news that Mitch Marsh will need ankle surgery, to be able to bring someone of Dean’s calibre to the club, at such short notice, for the first period of the season is a real bonus.
“We know Dean well after his time with us in 2015 and his international quality and experience will be a real asset. We look forward to welcoming him to the Kia Oval.”