Disclosed is a mucoadhesive pharmaceutical composition comprising a poly-ionic complex of chitosan and a polyacrylic acid polymer. As an oral formulation, the composition has the extended retention time in the gastrointestinal tract by its mucoadhesive and swelling properties, which is useful as sustained release formulations, retentive formulations of active ingredients with limited absorption regions, and active ingredients with pH dependent solubility.