The centuries-old fascination with witches is to be the subject of a major exhibition at the National Galleries of Scotland.

Witches and Wicked Bodies, opening in July 2013 at the Scottish National Gallery of Modern Art, will feature works from the last 500 years, including pieces by Albrecht Dürer, Francisco de Goya, Henry Fuseli, John William Waterhouse and William Blake, as well as more contemporary artists including Paula Rego and Edward Burra.

The exhibition has been curated by the National Galleries (NGS) with the artist and writer Deanna Petherbridge and will include works on loan from major collections including the British Museum, the Ashmolean in Oxford, the V&A and the Tate.

John Leighton, director general of the NGS, said: "We look to offer our public a world-class yet very distinctive programme of exhibitions. I believe this is the first time witchcraft across the ages has been the subject of a major art exhibition in the UK and we are delighted to be partners with the British Museum on this truly fascinating and compelling show."

The exhibition will focus on six key themes with the centrepiece of Witches' Sabbaths and Devilish Rituals being Salvator Rosa's masterpiece Witches at their Incantations, which will be on loan from the National Gallery in London.

Unnatural Acts of Flying will include the origins of the image of the witch as an old woman riding a broomstick against a night sky.

Other themes include Magic Circles, Incantations and Raising the Dead and Hideous Hags and Beautiful Witches.

Works depicting the witches in Shakespeare's Macbeth will include John Martin's theatrical large-scale painting of Banquo and Macbeth lost on the blasted heath.

The thematic survey will culminate with The Persistence of Witches including works by Kiki Smith and Rego.

Rego's 1996 work Straw Burning relates to the Pendle Witch trials which took place in 1612 in Lancaster.