The news was announced by BBC Three controller Zai Bennett at the Edinburgh TV Festival on Thursday (August 23).
The sitcom, about a hopelessly incompetent school teacher played by Whitehall, managed to get BBC Three's highest ratings for a first episode of a comedy ever.
Its second episode was similarly successful.
Mathew Horne plays the school's desperate-to-be-cool headmaster, with Sarah Solemani (Him and Her) as the teacher that Whitehall's character lusts after.
Bennett also confirmed that the Russell Kane-hosted Live at the Electric will get two more series.
Watch a trailer for Bad Education below: