Hamburg have completed the signing of free agent Emir Spahic, almost three months after he was sacked by Bayer Leverkusen for headbutting a steward.