Jacob Thompson, 9, died Sunday after fighting a rare cancer for four years. (Family photo)

Jacob Thompson spent nearly half of his short life battling cancer.

The 9-year-old boy, who loved penguins, died Sunday, four years after he was diagnosed with Stage 4 neuroblastoma, a rare cancer that affects mostly young children.

As his family had expected, Thompson didn’t live long enough to celebrate Christmas, a holiday he loves. But before his death, thousands of complete strangers inspired by the terminally ill Maine boy’s story brought an early Christmas to him.

They decorated his hospital room with a tree, requested a special visit from Santa Claus, and sent him gifts and scores of homemade holiday cards.

Jacob and his family celebrated Christmas on Nov. 12.

He died a week later.

“Each and every person who sent Jacob a Christmas card, a gift, a Facebook message or video, or a prayer made a difference in the final days of his life,” his family wrote on a Facebook page they used to chronicle his journey. “You brought Jacob joy, and you brought us all optimism for the future. Thank you for taking the time, and taking an interest in our sweet boy’s journey. Sadly, there are many others like him that we hope you will continue to help.”

Jacob was admitted to the hospital “for the last time” Oct. 11, his mother, Michelle Thompson Simard, wrote on a GoFundMe page. The cancer had spread to his skull and to several bones in his inner ear.

His hip was so covered with tumors that it looked like lace, Thompson Simard wrote. Chemotherapy and radiation had offered little signs of hope.

The boy’s family was “told that we should be spending as much time as possible with him and we should start making arrangements for his passing,” Thompson Simard wrote, adding later, “No one thinks about having to do this type of planning for their child and because of that we did not nor do not have life insurance on him.”

The GoFundMe campaign had raised nearly $165,000 as of Tuesday morning to pay for Jacob’s funeral.

Thompson Simard documented the response from people who sent Christmas cards and toys to make the early holiday memorable for Jacob.

On Nov. 1, she posted a picture of Jacob with the first card he received. It featured a penguin, which his family, from Saco, Maine, said was his favorite animal.

For days, Jacob was showered with presents.

Pictures his mother shared on social media showed boxes of toys, games, books, cards and, of course, more penguins — including penguin socks.

He even received a video greeting from actor Rob Lowe and the cast of “Code Black.”

Barbara Bush Children’s Hospital in Portland, Maine, where Jacob was being treated, said the response was “wonderfully overwhelming” but asked people to not personally deliver cards to the hospital because of safety concerns.

On Thursday, three days before Jacob died, his family shared a picture of him in his hospital bed wearing a blue Superman T-shirt. His dog, Piper, was lying near his feet.

Jacob had just gone through a round of radiation to help him with some pain in his leg, his family wrote.

“Jacob spends most of his time resting, but has had a few good hours to play and open all your cards and gifts,” his family wrote.

In the post announcing Jacob’s death, his mother said she hoped his case would help raise awareness about neuroblastoma, a rare type of cancerous tumor that affects mostly infants and young children, according to the American Cancer Society. There are about 700 new cases every year in the United States. The majority are diagnosed by age 5.

“We hope that Jacob’s story and the enormous outpouring of support from around the world will have a lasting impact on raising awareness for this disease,” she wrote. “We hope that donations will be made, and a cure will be discovered as a result.”

She requested that any donations in Jacob’s honor be made to Operation Gratitude or a penguin rescue group. “Or, pay it forward in your community,” she wrote. “Do something for others, donate blood and platelets, or use your talents to bring shelter, nourishment or joy to those in need in honor of Jacob’s memory. And most importantly, remember to #LiveLikeAPenguin for Jacob.”

Read more:

She chose to die so she could give birth. Now her newborn is dead, too.

The simple way you can make Christmas merry for this 8-year-old arson survivor

Child who asked for Christmas cards got more than 1 million — including one from the Obamas