Foster joins Blues
Manager Alex McLeish was looking to strengthen his goalkeeping department having had Joe Hart, selected in Fabio Capello's England squad for the FIFA World Cup, on loan from Manchester City this season.
However, with that arrangement unlikely to be repeated in the coming campaign the Birmingham boss has moved to find a replacement.
Foster, 27, found opportunities limited at Old Trafford and fell down the pecking order behind Edwin van der Sar and Tomasz Kuszczak after a number of unconvincing displays. He made just nine English Premier League starts and his last first-team appearance came on 23 February against West Ham.