Following the Reduction, De la Gardie lost his influence and most of his fortune, and since King Charles XI declined to buy the palace, De la Gardie was finally forced to hand it over to Johan Gabriel Stenbock to settle a debt, and in 1683 Stenbock took over the newly rebuilt palace, only to sell it to the king in 1688. Karlberg thus became the palace where crown prince Charles spent much of his childhood and where he used to hunt wolves in the surrounding forests. His mother, Queen Ulrika Eleonora (1656 - 1693), had a school, the "Tapetskolan vid Karlberg", created for orphaned girls where they could create tapestries. On her death, her son took personal charge over the school to honour his good-hearted mother. When Charles XII died in 1718 his coffin was taken to Karlberg before being interred in the church Riddarholmskyrkan.