Beginning in the 1880s, Burnett began to travel to England frequently and in the 1890s bought a home there, where she wrote The Secret Garden. Her oldest son, Lionel, died of tuberculosis in 1890, which caused a relapse of the depression she had struggled with for much of her life. She divorced Swan Burnett in 1898, married Stephen Townsend in 1900, and divorced him in 1902. A few years later she settled in Nassau County, New York, where she died in 1924 and is buried in Roslyn Cemetery.
In 1936 a memorial sculpture by Bessie Potter Vonnoh was erected in her honour in Central Park's Conservatory Garden. The statue depicts her two famous Secret Garden characters, Mary and Dickon.