The 38-year-old, who played 329 Bundesliga matches between 1998 and 2003, had also been targeted by VfL Wolfsburg and Borussia Dortmund, but rejected both offers.
He signed for Stuttgart five days before his country opens their Euro 2008 campaign against Poland in Klagenfurt, Austria, on Sunday.
He will join the 2007 Bundesliga champions after this month’s tournament which takes place in Austria and Switzerland from June 7-29 in place of Raphael Schafer, who has failed to impress since his arrival from Nuremberg last July.
“Discussions with the main people at Stuttgart have been very good from the start, I am looking forward to playing for them and being back in the Bundesliga next season,” said Lehmann on Tuesday, after training with the Germany squad in Ascona, Switzerland.
Stuttgart coach Armin Veh said he was delighted to sign Lehmann, who has 54 caps and has been the national goalkeeper since the 2006 World Cup.
“Jens was our prefered candidate from the very beginning,” said Veh in a VFB statement. “His qualities are undisputed and the whole squad will benefit from his huge experience.”
But after losing his place at Arsenal last season there has been debate as to whether he should remain Germany’s number one shot-stopper.
Before joining Arsenal in 2003, Lehmann played for Schalke 04 (1988-98), AC Milan (1998-99) and Borussia Dortmund (1999-2003).