The Madagascar crew are still attempting to get back to NewYork.
They buy a run down circus, bond with new friends and bring the circus back to its former glory, all while trying to get back to the Zoo in NewYork.
While on their adventure, they are hunted by an Animal Control Officer name Captain DuBois, a crazed woman who collects animal heads on her walls and wants Alex's head for her collection.
The Madagascar crew leaves the circus (sadly) and returns to the Zoo, finally home they realize they were happier out of the zoo, with their new circus family.
As they attempt to leave the zoo and return to the circus, Captain DuBois traps them all, except Julien, who returns to the circus to get help. DuBois is given a reward by the zoo for returning it's animals but she rips up the check and attempts to shoot Alex while he is on display at the ceremony.
The circus troupe show up and rescue their Madagascar pals. (performing a perfect circus event for all to see).
The entire circus troupe is shown sometime later out on the road together to perform for their next big circus show. Captain DuBois and her team of bad guys are on a ship, in crates, headed for Madagascar.