Charity Books Abroad had been forced to keep the books under police protection at the Huntly police station in Aberdeenshire after the bank in town revealed that it was not insured to look after the Rowling-signed literary series.
Bidding for the set ended at midnight Sept 30 and the books were sold for 18,200 pounds, reports The Sun.
Rowling decided to donate an entire set after her mom-in-law Barbara Murray, asked her to donate one book for the charity for which she works as part of the organisation's 25th anniversary celebrations.
Books Abroad supplies books to schools across the world.
A letter of authenticity from Rowling was also sold at the auction.