(CNN) -- After years of saving and fundraising, the graduating class of New Hampshire's Profile Senior High School finally had $8,000 for their senior trip.
It was supposed to be a getaway to Ridin' Hy Ranch and Resort -- four days of revelry and relaxation in New York's Adirondack Mountains.
But about a week before the trip, Principal Courtney Vashaw told students about a personal battle: she had an aggressive form of cancer, CNN affiliate WMUR reported.
So the seniors took a vote -- and told her about their unanimous decision:
"We decided not to go on our senior class trip this year and donate all of our funds to your cause," class treasurer Ian Baker said.
Vashaw shook her head and covered her eyes, overcome with emotion.
"It is very hard for me to accept help, and I have no idea what to say to you," she said.
The principal doesn't normally like to talk about her private life, but knew she had to tell students why she'd be gone from school for a while.
Baker said the decision was easy.
"She's just very caring, very selfless, and we wanted to be selfless, too," he told WMUR.
Class president Christopher Sirois said every senior at the school, which has about 180 students, has a connection to Vashaw.
"She has given so much to us that we just wanted to give back," he told the affiliate.
Once Vashaw was able to speak again, she praised the seniors
"They are (a) pretty remarkable, fun, astonishing group of people," she told WMUR.
The seniors are planning a different senior class trip, but one that is local and less expensive, the affiliate said.
And just because they're graduating on June 5 doesn't mean they're leaving Vashaw. The seniors said they plan to have more fundraisers for her.
™ & © 2015 Cable News Network, Inc., a Time Warner Company. All rights reserved.