Missouri police officers pooled their money together and bought costumes for children in need on Tuesday after finding out some students at a local elementary school couldn’t afford to get one for the school’s Halloween party.

While working their midnight shift, several Wentzville police officers became aware that there was a need for costumes at Heritage Elementary School, department spokesman Jacob Schmidt told Fox News.

Schmidt said Sgt. Marc White came across two Facebook posts from Heritage teachers stating that there were several students who weren’t going to be able to dress up for their class party on Thursday. In the post, the teachers asked for donations of gently-used or new costumes so that the children would be able to dress up and wouldn’t feel excluded.

Around 12:30 a.m. on Tuesday, Sgt. White mentioned the posts to the five other Wentzville police officers working at the time and told them he was going to buy a few costumes from Walmart since the store was open 24 hours, Schmidt said.

DEMI LOVATO STUNS IN MARIE ANTOINETTE-INSPIRED HALLOWEEN COSTUME

“One of the officers says, ‘I’ll buy one if you buy one,’” Schmidt told Fox News. “They end up pooling enough money between the six of them to buy 10 costumes. “

After the sergeant officers bought the costumes, some of them held them up in front of the school and took a picture. Sgt. White then commented on one of the teacher’s posts with the photo, Schmidt said.

He added that the officers left the costumes in the school resource officer’s office with a note asking that they be delivered to one of the teachers who had asked for donations.

FIVE FEEL-GOOD STORIES FROM THIS WEEK YOU DON'T WANT TO MISS

“It was $150-200 that they pooled together,” Schmidt told Fox News. “They just wanted to do a nice gesture.”

On Tuesday, the Wentzville Police Department tweeted the photo and wrote, “Last night, Sgt. White and officers from P4 [Platoon 4] heard of a need for Halloween costumes for students at Heritage Elementary School. They pooled their money and bought 10 costumes so they can participate in all the Halloween fun and trick or treat this Thursday night. Great job P4!”

The department also posted the photo on Facebook, which Schmidt said prompted several people to ask how they can donate costumes as well.

The Heritage Elementary Parent Teacher Association responded with a Facebook post writing, “This is why we love our Heritage and Wentzville community.”

OHIO TEEN WITH ONE ARM KICKS BULLYING TO THE CURB WITH SIGHTS SET ON PARALYMPIC GAMES

“We are not just responsive for calls for service, we really do try to go out there and help the community,” Schmidt told Fox News. “More than half of our police officers live in town so we have a vested interest in the community.”

“The whole mission at this point is to make sure every student has a costume so they can participate,” he added.

Some teachers at Heritage Elementary School posted on their personal social media accounts asking for costume donations after the school’s principal sent an email to staff identifying that there was a need following concerns from students, Mary LaPak, the school's chief communications officer said.

CLICK HERE TO GET THE FOX NEWS APP

“The staff is overwhelmed with the kindness, generosity and support from the Wentzville Police and our community,” LaPak told Fox News.

Costume donations for grades K-6 are being accepted at Heritage Elementary School in Wentzville until 10 a.m. Thursday. The school's Halloween party will start later that day.