The story begins when the Spanish Ambassador moves in next door. His son, Pepito, is not a good boy. Madeline dubs him a 'bad hat'. The book is controversial due to the cruel nature of Pepito's mischief. After he suffers from his own actions, Pepito reforms himself. Pepito is also a main character in the stories Madeline in London and Madeline and the Gypsies.