The effect of interpolymer complex formation between positively charged chitosan and negatively charged gelatin (Type B) on the release behavior of tramadol hydrochloride from biodegradable chitosan-gelatin sponges was studied. Mixed sponges were prepared by freeze-drying the cross-linked homogenous stable foams produced from chitosan and gelatin solutions where gelatin acts as a foam builder. Generation of stable foams was optimized where concentration, pH of gelatin solution, temperature, speed and duration of whipping process, and, chitosan-gelatin ratio drastically affect the properties and the stability of the produced foams. The prepared sponges were evaluated for their morphology, drug content, and microstructure using scanning electron microscopy, mechanical properties, uptake capacity, drug release profile, and their pharmacodynamic activity in terms of the analgesic effect after implantation in Wistar rats. It was revealed that whipping 7% (w/w) gelatin solution, of pH 5.5, for 15 min at 25 degrees C with a stirring speed of 1000 rpm was the optimum conditions for stable gelatin foam generation. Moreover, homogenous, uniform chitosan-gelatin foam with small air bubbles were produced by mixing 2.5% w/w chitosan solution with 7% w/w gelatin solution in 1:5 ratio. Indeed, polyionic complexation between chitosan and gelatin overcame the drawbacks of chitosan sponge mechanical properties where, pliable, soft, and compressible sponge with high fluid uptake capacity was produced at 25 degrees C and 65% relative humidity without any added plasticizer. Drug release studies showed a successful retardation of the incorporated drug where the t50% values of the dissolution profiles were 0.55, 3.03, and 4.73 hr for cross-linked gelatin, un-cross-linked chitosan-gelatin, and cross-linked chitosan-gelatin sponges, respectively. All the release experiments followed Higuchi's diffusion mechanism over 12 hr. The achieved drug prolongation was a result of a combined effect of both cross-linking and polyelectrolyte complexation between chitosan and gelatin. The analgesic activity of the implanted tramadol hydrochloride mixed chitosan-gelatin sponge showed reasonable analgesic effect that was maintained for more than 8 hr. Therefore, the use of chitosan and gelatin together appears to allow the formulator to manipulate both the drug release profiles and the mechanical properties of the sponge that could be effectively implanted.