Shrek is grumpy, smelly and ugly ogre, living peacefully in a swamp. One night, he suddenly finds his land has been squatted by a mass of fairy-tale creatures (Pinocchio, the three little pigs, Peter Pan, Snow White, Cinderella, among others), who have been banished by the evil lord Farquaad. One of these is donkey (who just won't shut up). Accompanied by him, Shrek confronts Lord Farquaad, demanding his land back.
Farquaad does him a deal, telling him to rescue princess Fiona from a dragon-guarded castle, to get his swamp back. Shrek and Donkey go and rescue the Princess, narrowly avoiding being burned by the dragon. Fiona is disgruntled about being rescued by an ugly ogre, rather than Prince Charming. However, despite their differences, she and Shrek grow fond of each other.
On the second night of their return journey, Fiona hides in a windmill. Donkey finds her, and discovers that she's turned into an ogress. She explains that she's under a spell, which can only be broken by true love's first kiss. Shrek overhears part of this, but misunderstands and thinks she doesn't love him because he's ugly. Just as she decides to tell Shrek the truth, the sun rises and she becomes a beautiful princess again.
Lord Farquaad arrives and takes Fiona to his castle, and Shrek returns to his swamp. Both are miserable. Later, Shrek, Donkey and Dragon head to Farquaad's castle, to try to stop Fiona marrying him. When they arrive, the sun sets and Fiona becomes an ogress again. Farquaad doesn't want to marry her, and sets the guards on everybody, but Dragon comes to the rescue and eats Farquaad. Shrek and Fiona kiss. Therefore, Fiona stays ugly (in conformity with the spell: "you find true love's first kiss and then take love's true form"), and marries Shrek, and they live "ugly" ever after.