The 31-year-old, who missed out on a place in his country's Euro 2012 squad, made 98 appearances for Hamburg in four years at the club.
"I like the Premier League and it has always been one of my wishes to come here," Petric told Fulham's website.
"I played with Hamburg against the club two years ago in the Europa League. It was nice to play at Craven Cottage with a fantastic crowd."
Petric has won 44 caps for Croatia.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.