Originally, Julien was intended to be a minor character with only two lines. However, when they cast Sacha Baron Cohen for the role, he improvised not only an Indian accent, but eight minutes of dialogue for his recording. The producers found Cohen's performance so funny that they decided to rewrite the script to make Julien have a much more prominent presence in the story as King of the Lemurs.
Sacha Baron Cohen improvised the line "It's got a gecko on it", and all of the following dialog related to the gecko. The filmmakers found it so funny that they went to the extra work of creating a CG gecko for the shot.
Melman the giraffe wears tissue boxes on his feet. This is a reference to Howard Hughes who was also a hypochondriac and suffered OCD (obsessive compulsive disorder). In his later years, Hughes wore tissue boxes on his feet believing this would keep away germs.
The penguins originated from a film director Eric Darnell was developing, called "Rockumentary", about The Beatles-like rock quartet. When that project was canceled and Darnell was moved to this movie, he incorporated the penguins into the script, changing them from musicians to military commandos.
Harry Gregson-Williams was originally attached as the film's composer, but was replaced by Hans Zimmer. A few weeks earlier, the opposite had occurred for another film: Gregson-Williams replaced Zimmer for the scoring duties of Kingdom of Heaven (2005).
When Private is attempting to commandeer the oil tanker, "WHATApiece OFworkIsPenGuin" can been seen on the computer screen behind him. This spoofs the William Shakespeare quote, "What a piece of work is man!" from "Hamlet".
When the camera pans backward from Alex's crate in the ocean, the sea foam around him creates the head of a lion. Foam makes the face, and the absence of foam around that makes the mane. Alex is in the left eye of the face.