In 1623, seven years after Shakespeare's death, his colleagues published a collection of 36 of his plays in folio format. The First Folio, as it is commonly known, groups Shakespeare's plays into three distinct categories: comedies, tragedies, and histories. The First Folio designates Macbeth as a tragedy, but this classification is dubious for a number of reasons.
Several of Shakespeare's histories have tragic endings—Richard II and Richard III, for example, both end with the violent death of the title character—but while the First Folio generally classifies plays like Julius Caesar and Antony and Cleopatra (which deal with Greek, Roman, and other "foreign" history) as tragedies, historical plays set in England are characterized as histories. Macbeth, although primarily set in Scotland, includes several characters and events drawn from English history, and Shakespeare also relied heavily on Holinshed's Chronicles, the same source he used for many of his English history plays, while writing Macbeth.
One could argue that, since Macbeth is so highly fictionalized and historically inaccurate, it no longer counts as a history, but the majority of Shakespeare's history plays are similarly fictitious. Many plays, especially those depicting the Wars of the Roses (which ended with the ascension of House Tudor to the English throne) bear little resemblance to actual history and instead function as political propaganda intended to justify the reign of Elizabeth I and her family. Henry VIII, for example, thoroughly sanitizes the story of Elizabeth's parentage by completely avoiding Anne Boleyn's disgrace and beheading and omitting any mention of Henry VIII's four succeeding wives. Macbeth similarly sanitizes the image of Banquo, who was at the time believed to be the ancestor of House Stuart, in order to support the reign of James I.
Even the supernatural elements in Macbeth would not preclude it from being classified as a tragedy. In Richard III, a play that bears numerous similarities to Macbeth, several characters experience prophetic dreams, and the title character is haunted by the ghosts of those he has murdered.
Nevertheless, the First Folio classifies Macbeth as a tragedy. Like most of Shakespeare's tragedies, it was written during the reign of James I, a trend that appears to reflect a general societal unease following the death of Elizabeth I. Shakespearean tragedies tend to resemble ancient Roman tragedies, which center on characters of noble birth who possess a tragic flaw or commit a grave error that leads to a reversal of their fortunes. Prince Hamlet's doubt prevents him from avenging his father's murder, Iago easily manipulates Othello's jealousy, and King Lear's fatal flaw is his pride.
One could argue that Macbeth's fatal flaw is his ambition, but this interpretation isn't necessarily supported by the text. Several other characters, including Banquo, are shown wresting with their ambition, suggesting that this trait is less of an individual failing than it is an intrinsic aspect of human nature. Macbeth is also different from Shakespeare's other tragedies in that it lacks any real sense of moral ambiguity. Unlike Othello, who is deceived into killing Desdemona, or Brutus, who aids in the assassination of Caesar because he truly believes he is acting in the best interests of Rome, Macbeth is fully aware that his actions are evil and unjustified, which makes his fall from grace somewhat less tragic.