The 32-year-old had been without a club since his release from Fulham earlier in the summer but has joined the Hammers on a deal until the end of the season.
Hammers boss Sam Allardyce was close to re-signing Carlton Cole but failed to complete a deal and has instead opted to add Petric as he looks to bolster his attacking options, with star forward Andy Carroll suffering an injury setback on Monday.
|WEST HAM LATEST
|17/1||West Ham are 17/1 with PaddyPower to win both halves against Southampton
"I know [the Premier League] and I'm happy to be back in the Premier League because it's a fantastic league and I'm really looking forward to being part of this team and this club.
"There are a lot of good players here and I'm happy to be part of such a good team and I hope we can all celebrate my first goal for West Ham as soon as possible.
"I didn't speak to Sam [Allardyce] until [Tuesday] but I've heard a lot about him and I spoke to Guy Demel, who I know from my time at Hamburg, and I'm sure I'll have a good time here.
"I remember playing at West Ham last year and it was a very tough game for us at Fulham. I think we lost 3-0! It's not easy to come here and take points away."
Petric has previously played for Bundesliga sides Borussia Dortmund and Hamburg and netted five goals in 10 starts for Fulham.